Imports System.Data.SqlClient Imports System.Linq Imports System.Data Public Class Form Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Dim conn As SqlConnection 'Dim cmd As SqlCommand Dim rd As SqlDataReader Dim conn As New SqlConnection() Dim cmd As New SqlCommand() conn.ConnectionString = "Data Source=localhost;Initial Catalog=user;Integrated security=true" cmd.Connection = conn conn.Open() cmd.CommandText = "Select login,password from user where login='" & TextBox1.Text & "'and password='" & TextBox2.Text & "'" rd = cmd.ExecuteReader If rd.HasRows Then Welcome.Show() Else MsgBox("Invalid Login or Password") End If End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)