i have two textboxes one for user name and another for
password . i have a table name compare(which contains
name,passwod etc.,)my doubt is how compare username
textbox with name column and how compare password textbox
with passwod column. i want the code
Answer Posted / suchit kumar dash
Dim con as new SqlConnection
Dim cmd as new SqlCommand
Dim dr as SqlDataReader
Dim str,str1 as String
Dim I_Int as Integer=0
PageLoad
--------------
str="Server=......;Database=......;Trusted_Connection=Yes;User
Id=sa;Password=sa;"
con=new SqlConnection(str)
Login BUtton
--------------
str1="select * from TableName where User_Name='"&
TextBox1.Text &"' and Password='" & TextBox2.Text &"'"
cmd=New SqlCommand(str1,con)
dr=cmd.ExecuteReader
while(dr.Read())
i_int=i_int+1
End while
if i=0 then
MessageBox.Show("Please Enter correct User Id and Password")
else
Endif
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
What is ado asp?
What is difference between connected and disconnected architecture in ado.net?
What is data view and variable view?
How to creating a SqlCommand Object?
What is difference between dataset and datatable?
What is difference between Dataview and Datatable?
What is the use of data grid?
Explain the difference in record set and dataset?
Explain the difference between an ado.net dataset and an ado recordset?
What is meant by ‘transaction’ in a database and what are the ‘properties of transaction’?
What is the difference between OLEDB Provider and SqlClient?
How to read data with the sqldatareader ?
Describe briefly an ADO.NET Dataset ?
What is difference between sqldatareader and sqldataadapter?
Can we load multiple tables in a dataset?