 |
|
Code
Server Error in '/esrithWeb_1' Application.
ExecuteScalar requires an open and available Connection. The connection's current state is closed.
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: ExecuteScalar requires an open and available Connection. The connection's current state is closed.
Source Error:
Line 27: strSQL = "SELECT COUNT(*) FROM Adminsystem WHERE username = '" + this.txtUsername.Text + "' AND [password] = '" + this.txtPassword.Text + "' ";
Line 28: objCmd = new SqlCommand(strSQL, objConn);
Line 29: intNumRows = Convert.ToInt32(objCmd.ExecuteScalar());
Line 30: if (intNumRows > 0)
Line 31: {
Source File: c:\inetpub\wwwroot\esrithWeb_1\Manage\checkuser.aspx.cs Line: 29
Stack Trace:
[InvalidOperationException: ExecuteScalar requires an open and available Connection. The connection's current state is closed.]
System.Data.SqlClient.SqlConnection.GetOpenConnection(String method) +6392995
System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command) +13
System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async) +271
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +138
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +28
System.Data.SqlClient.SqlCommand.ExecuteScalar() +220
Manage_checkuser.btnLogin_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\esrithWeb_1\Manage\checkuser.aspx.cs:29
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
Tag : ASP
|
|
 |
 |
 |
 |
Date :
2012-08-27 17:09:20 |
By :
MySeason22 |
View :
2619 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |