469,307 Members | 1,799 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,307 developers. It's quick & easy.

Login page for mobile application

I get the following error on page when I click Login button: I've attached Code. Please please help .

ExecuteReader: Connection property has not been initialized.
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: ExecuteReader: Connection property has not been initialized.

Source Error:

Line 47: sqlCommand1.Parameters["@password"].Value=txtPassword.Text;
Line 48: sqlConnection1.Open();
Line 49: int nCount = (int)sqlCommand1.ExecuteScalar();
Line 50: if (nCount ==1)
Line 51: {

Source File: c:\inetpub\wwwroot\mobilespeech\login.aspx.cs Line: 49

Stack Trace:

[InvalidOperationException: ExecuteReader: Connection property has not been initialized.]
System.Data.SqlClient.SqlCommand.ValidateCommand(S tring method, Boolean executing) +251
System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +80
System.Data.SqlClient.SqlCommand.ExecuteScalar() +177
MobileSpeech.login1.cmdLogin_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\mobilespeech\login.aspx.cs:49
System.Web.UI.MobileControls.Command.OnClick(Event Args e) +80
System.Web.UI.MobileControls.Command.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String argument) +82
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
System.Web.UI.MobileControls.MobilePage.RaisePostB ackEvent(IPostBackEventHandler sourceControl, String eventArgument) +78
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
Attached Files
File Type: doc login mobile.doc (30.0 KB, 284 views)
May 3 '06 #1
0 1218

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Beginner | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.