Friday, February 24, 2012

Help me to fix this error

hi all

Server Error in '/test' Application.

Cannot open database requested in login 'mehr'. Login fails. Login failed for user 'COMPUTER2\ASPNET'.

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.Data.SqlClient.SqlException: Cannot open database requested in login 'mehr'. Login fails. Login failed for user 'COMPUTER2\ASPNET'.
Source Error:
Line 67: Line 68: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickLine 69: cmd.Connection.Open()Line 70: cmd.ExecuteNonQuery()Line 71: cmd.Connection.Close()

Source File:c:\inetpub\wwwroot\test\WebForm1.aspx.vb Line:69
Stack Trace:
[SqlException: Cannot open database requested in login 'mehr'. Login fails.Login failed for user 'COMPUTER2\ASPNET'.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +474 System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 test.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\test\WebForm1.aspx.vb:69 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1277


Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573


thanks for your replyMeans user computer2/aspnet isnt a valid user in your database mehr. You either need to add the user, or add a different user to your connection string.

Nick

No comments:

Post a Comment