Imports System.Data.SqlClient
Imports System.Data
Public Class Form33
Dim cnn33 As SqlConnection
Dim adp33 As SqlDataAdapter
Dim i As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ds As New DataSet
adp33.Fill(ds, "login")
For i = 0 To ds.Tables(0).Rows.Count - 1
If TextBox1.Text.Trim = Trim(ds.Tables(0).Rows(i)(0)) And TextBox2.Text.Trim = Trim(ds.Tables(0).Rows(i)(1)) Then
MDIParent1.Show()
GoTo ss
End If
Next
If i = ds.Tables(0).Rows.Count Then
MsgBox("Invalid password ...")
End If
ss:
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Hide()
End Sub
Private Sub Form33_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cnn33 = New SqlConnection("Data Source=dell-pc;Initial Catalog=health_care;Persist Security Info=True;User ID=sa;Password=sa;")
adp33 = New SqlDataAdapter("select * from login ", cnn33)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim ds As New DataSet
adp33.Fill(ds, "login")
For i = 0 To ds.Tables(0).Rows.Count - 1
If TextBox1.Text.Trim = Trim(ds.Tables(0).Rows(i)(0)) And TextBox2.Text.Trim = Trim(ds.Tables(0).Rows(i)(1)) Then
Form34.Show()
GoTo ss
End If
Next
If i = ds.Tables(0).Rows.Count Then
MsgBox("Invalid password ...")
End If
ss:
End Sub
End Class
x-ray (save,reset,exit) code
Imports System.Data.SqlClient
Imports System.Data
Public Class Form8
Dim ds8 As New DataSet()
Dim dt8 As New DataTable()
Dim connetionstring8 As String
Dim cnn8 As SqlConnection...
No comments