i am calling the OledbConnection
to Microsoft Access Database. there is no issue calling the method and also retrieves necessary data.
i dont know after that method the session timeouts automatically. and goes to login page. why? i have lost entire day debugging and finding the issue.
string strQuery = "select count(LOC1) as LOC1 from shrmwise";
DataTable dt = new DataTable();
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
connection.Open();
using (OleDbCommand command = new OleDbCommand(strQuery, connection))
{
try
{
OleDbDataReader reader = command.ExecuteReader();
dt.Load(reader);
reader.Close();
}
catch (Exception ex)
{
throw ex;
//Console.WriteLine(ex.Message);
}
finally
{
connection.Close();
}
return dt;
}
}
Edited
Does not timeout if the above method call is commented.
it does not timeout on localhost, but on live server.
my connectionString as follows
string connectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"Data Source=E:\Data\MyDatabase.mdb;" +
@"User Id=;Password=;";