Dim con As New SqlConnection con.ConnectionString = "data source=.\SQLEXPRESS;integrated security=sspi;initial catalog=pass;"
con.Open()
Dim com As New SqlCommand
With com
.Connection = con
.CommandText = "select * from pp where user_name='" & TextBox3.Text & "'and pas='" & TextBox4.Text & "'"
End With
Dim reader As SqlDataReader = com.ExecuteReader
If reader.HasRows = True Then
Form3.Show()
Else
MsgBox("نام کاربری یا پسورد به درستی وارد نشده است", MsgBoxStyle.Critical, "خطا")
TextBox3.Text = ""
TextBox4.Text = ""
TextBox3.Select()
End If