Click here to Skip to main content
15,896,727 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim con As New SqlConnection("user id=sa;password=siva;server=192.168.76.122;Initial Catalog=Travel")
        Dim cmd As New SqlCommand("Tra_login ", con)
        cmd.CommandType = CommandType.StoredProcedure

        cmd.Parameters.AddWithValue("@UserName", txtusername.Text)
        cmd.Parameters.AddWithValue("@PassWord", txtpassword.Text)
        cmd.Parameters.AddWithValue("@result", 0)
        cmd.Parameters("@result").Direction = ParameterDirection.Output
        con.Open()
        cmd.ExecuteNonQuery()// error got here .Invalid object name 'login'. 
        con.Close()
        If cmd.Parameters("@result").Value = 0 Then
            MsgBox("Please enter correct password and username")
        Else
            HttpContext.Current.Response.Redirect("mypage.aspx")
        End If
    End Sub
End Class
Posted

LOGIN Table name does not exists in your database. Please check table name LOGIN in your database.


Thanks
Ashish
 
Share this answer
 
Check your stored proc Tra_login.
Run it in SQL Server with appropriate parameters to see if it is generating an output.

Note that you have given your password on a public forum.
Never a good idea.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900