y it dont update ???

wondery

Active member
Joined
Sep 12, 2003
Messages
43
Session["User"]= txtUserName.Text;
String strsql2 = "UPDATE tblUser SET LastLog=" + DateTime.Now
+ " WHERE UserName=" + Session["User"] + "";
SqlCommand sqlcomm2 = new SqlCommand(strsql2, sqlconn);
Response.Redirect("mailbox.aspx");
 
Last edited by a moderator:
The connection is already Open (state=Open).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The connection is already Open (state=Open).

Source Error:


Line 132: + "# WHERE UserName=" + Session["User"] + "";
Line 133: SqlCommand sqlcomm2 = new SqlCommand(strsql2, sqlconn);
Line 134: sqlconn.Open();
Line 135: sqlcomm2.ExecuteNonQuery();
 
Back
Top