<pre lang="vb"> Dim con As New SqlConnection("Data Source=D729Z\SQLEXPRESS;Initial Catalog=Franchise;Integrated Security=True") Dim da As New SqlDataAdapter Dim ds As New SqlDataSource Dim cmd As New SqlCommand Dim dr As SqlDataReader Dim dt As DataTable Dim str As String str = "select * from Adminlogin where Username='"& UnameTextBox.Text &"', ' " & UPassword.Text & " ' " da = New SqlDataAdapter(str, con) cmd = New SqlCommand(str, con) da.Fill(dt) If dt.Rows.Count < > 0 Then Response.Redirect("SelectBranch.aspx") Else MsgBox(" Username and password invalided ") End If cmd.ExecuteNonQuery() con.Close()</pre>
Dim dt As DataTable
Dim dt As New DataTable()
cmd = New SqlCommand(str, con) ' 'do other stuff ' cmd.ExecuteNonQuery()
ExecuteNonQuery
integer
str = "select * from Adminlogin where Username='"& UnameTextBox.Text &"' AND Password= ' " & UPassword.Text & " ' "
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)