Friday, March 30, 2012

log in failed

does anybody know what's wrong with this:

[SqlException: Login failed for user 'username\ASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
LouMayuga.lou_register.submit_button_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\LouMayuga\lou_register.aspx.vb:94
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()

I can't insert my data to my datbase and always got this kind of comment. I wonder whats wrong!

this is my code:
Private Sub submit_button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit_button.Click
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter

Me.SqlInsertCommand1.CommandText = "INSERT INTO [Log In] ([User Name], [User Password]) VALUES (@.Param1, @.Param2); SE" & _
"LECT [User Id], [User Name], [User Password] FROM [Log In]"
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@.Param1", System.Data.SqlDbType.VarChar, 50, "User Name"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@.Param2", System.Data.SqlDbType.VarChar, 50, "User Password"))
Me.SqlConnection1.ConnectionString = "workstation id=""EFREN-0SLIO0"";packet size=4096;user id=efren;integrated securi" & _
"ty=SSPI;data source=""efrenmay-0slio0"";persist security info=False;initial catalo" & _
"g=BizTalkDTADb"
Me.SqlConnection1.Open()
Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "Log In", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("User Id", "User Id"), New System.Data.Common.DataColumnMapping("User Name", "User Name"), New System.Data.Common.DataColumnMapping("User Password", "User Password")})})
Me.SqlConnection1.Close()
End Subview post 673219

hth

No comments:

Post a Comment