Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / sonj

dim qry as string = SELECT name,password FROM compare where
name = '" + txtName.text + "' AND password = '" +
txtPassword.txt + "'"

Dim ConectionString As String = "User ID=xxx;Password = yyy;
Initial Catalog='" + DataBaseName + "';Data Source=<System No>"

dim con as SqlConnection = New SqlConnection(ConectionString )
con.open

dim cmd as SqlCommand = new SqlCommand(qry,con)
dim dr as SqlDataReader = cmd.ExectueReader

if dr.HasRows = True then
messagebox.show("User ID Found")
else
messagebox.show("User ID Not Found")
end if

Above is the one example. There are various ways to validate
fox example you can write a stored procedure to validate
ID,Password and avoid SQL Injection etc.,

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is command class in ado.net?

993


What is data relation in ado.net?

1043


Define Execute Reader?

1050


Which control of the BindingNavigator returns the current position within the data source?

1157


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

1043


What is difference between ado and other data object?

899


What is the difference between ado.net and oledb?

931


What is openrowset?

965


What is linq and entity framework?

981


Which database is the ado.net?

952


What is the return type of executescalar?

996


What are the data providers in ADO.NET framework?

1016


Data reader read and forward only, how is it possible to get 2 tables of data at a time?

901


Which one of the following objects is a high-level abstraction of the connection and command objects in ado.net?

1047


Which object is used to add relationship between two Datatables?

1029