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
Explain how to call the sql commands asynchronously in ado.net version 2.0?
Explain the role of data provider in ado.net? What is the role of data provider in ado.net?
I loaded the dataset with a table of 10 records. One of the records is deleted from the backend, how do you check whether all the 10 records were present while updating the data(which event and steps) and throw the exception 28 can datareader hold data from multiple tables?
Describe briefly an ADO.NET Dataset ?
How we can provide data to ado.net?
What are the ado.net components?
Which name space is used to get assembly details?
What is ado.net code?
how we can fire event in databound coulm in datagfrid withot using button?
What are ado.net objects?
What is the difference between executequery and executenonquery?
What is aggregate root?
How can we check that some changes have been made to dataset since it was loaded?
Define the data provider classes that is supported by ado.net?
Define executenonquery?