Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim a As Integer a = Me.UserlogTableAdapter1.userquery(Me.UserlogDataSet1.userlog, txtUsername.Text, txtPassword.Text) If a = 1 Then txtUsername.Text = "" txtPassword.Text = "" Button1.Enabled = False txtUsername.Focus() form2.Show() Else Button1.Enabled = False txtPassword.Text = "" txtUsername.Focus() txtUsername.SelectAll() c = c + 1 Select Case c Case 1 MsgBox("incorrect username or password.", MsgBoxStyle.Exclamation) Case 2 MsgBox("incorrect blah blah blah", MsgBoxStyle.Exclamation) Case Else Application.Exit() End Select End If End Sub
Private sub cmdLog_Click_1(ByVal sender as System.Object, byVal e As system.EventArgs) Handles cmdLog.Click Me.CreateParameter(txtUsername.text, txtPassword.text) end Sub Private function CreateParameter(ByVal Param3,Byval Param4) As System.Data.sqlClient.sqlParameter() try sqlSelectCommand1.Parameters("@Param3").Value=trim(Param3) sqlSelectCommand1.Parameters("@Param4").Value=trim(Param4) 'c=Me,SqlDataAdapter.SelectCommand.Commandtext() 'sqlSelectcommand1.CommandType=CommandType.text 'sqlConnection1.Open() '''?? 'sqlConnection1.Close() if dataset12.Login.Rows.Count>0 then dim frmx As new Form2 frmx.show() else counter = counter + Catch ex As Expetion end try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)