I want to get a person from database in C# with ADO.net.
I use this command:
System.Data.Common.DbCommand command = DatabaseManager.Database.GetStoredProcCommand(proc_name, firstName);
and then
object personID = DatabaseManager.Database.ExecuteScalar(command);
When I click a button, these commands calls two times.
In the first time it is OK. But the second time, I get TimeOutException
:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
I used command.Disposed();
and command.Connection.Close();
. But these not resolve my problem.
Please help me how I can resolve this problem.