mmarkym
Member
- Joined
- Aug 20, 2005
- Messages
- 13
- Programming Experience
- 3-5
I have this function with a Select statement. After the select statement I want to dtermine if the select statement was successful or not and if successful to redirect to a page.
Also is the syntax of the select statement correct?
Public Function Login(ByVal user, ByVal Pass) As String
cn.ConnectionString = "integrated security=true;data source='mark\netsdk';persist security info=False;initial catalog=Login"
cn.Open()
Try
Dim cmd As New SqlCommand
cmd.Connection = cn
cmd.CommandText = "SELECT * FROM Register WHERE Username = user and Password = pass"
Catch ex As Exception
MsgBox(ex.Message)
Finally
cn.Close()
End Try
End Function
Also is the syntax of the select statement correct?
Public Function Login(ByVal user, ByVal Pass) As String
cn.ConnectionString = "integrated security=true;data source='mark\netsdk';persist security info=False;initial catalog=Login"
cn.Open()
Try
Dim cmd As New SqlCommand
cmd.Connection = cn
cmd.CommandText = "SELECT * FROM Register WHERE Username = user and Password = pass"
Catch ex As Exception
MsgBox(ex.Message)
Finally
cn.Close()
End Try
End Function