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


Please Help Members By Posting Answers For Below Questions

What is ole in vb?

683


What are the different ado.net namespaces?

827


Does ado.net use odbc?

703


What are ado.net objects?

725


What are two types of transaction supported by ado.net?

752


How do you implement locking concept for dataset?

749


What two types of data providers does ADO.NET supply? What determines which one you should use?

739


What is the use of ADO.NET and XML web services?

794


Describe the disconnected architecture of ADO.NET’s data access model.

765


Explain the namespaces in which .net has the data functionality class.

763


What is data adapter in ado.net with example?

705


Define ado.net?

804


What is the advantage of ado.net?

755


What is Data Provider?

796


What is difference between entity framework and ado.net?

687