Dim m = "SELECT COUNT(user_id) FROM m WHERE(CONVERT(CHAR(8), date, 112) = CONVERT(CHAR(8), GETDATE(), 112))"
Dim t = "SELECT COUNT(user_id) FROM t WHERE(CONVERT(CHAR(8), date, 112) = CONVERT(CHAR(8), GETDATE(), 112))"
Dim A As Integer = Val(m)
Dim B As Integer = Val(t)
Dim Total As Integer = A + B
If Cnn.State = ConnectionState.Open Then
Conn.Close()
End If
Cnn.ConnectionString = Cnnstring
SqlSelect = "Select Count(*) From [admin_teacher] Where [idname]=@idname And [Password]=@password"
Dim OleCommand As OleDbCommand = New OleDbCommand(SqlSelect, Cnn)
OleCommand.Parameters.Add("@idname", OleDbType.VarChar).Value = txtUserName.Text
OleCommand.Parameters.Add("@password", OleDbType.VarChar).Value = txtPassword.Text
Cnn.Open()
Dim LoginSuccess As Integer = CInt(OleCommand.ExecuteScalar())
Cnn.Close()
If LoginSuccess > 0 Then
frmLogin2.Show()
txtUserName.Text = ""
txtPassword.Text = ""
Me.Hide()
Else
'Do something
End If