I use the following code to access a mdb file with a asp.net project:
OleDbConnection con = new OleDbConnection(strDbConnString);
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = con;
cmd.CommandText = "SELECT COUNT(*) FROM login WHERE Email=@ParamEmail";
object oResult = cmd.ExecuteScalar();
string lldt = DateTime.Now.ToString();
cmd.CommandText = "UPDATE login SET LastLogin=@ParamDate WHERE Email=@ParamEmail";
The problem is that the second cmd.ExecuteNonQuery() does fail! I mean it doesn't fail with any error message or anything. It just doesn't do anything, no matter what I try!
Both .Execute work fine when they are used ALONE! But if I use them in a row the second one doesn't do anything.
Since this is a Web-App I thought in terms of speed I can reuse the connection. Do I have to establish a new one everytime I use a .Execute command?
Or is there another problem with this code?
Thanks for help!