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...

What is sequence of code in retrieving data from database ?

Answer Posted / payal

//In this answer there is sqlserver
/*i write this code in vb.net with windows applications and
use sql server provider*/
//first need namespace

system.data.sqlclient
//need connection,command,connection string

dim sqlcmd as sqlcommand
dim sqlcon as sqlconnection
dom da as sqldataadaptor
dim ds as dataset
dim constr as sting="user
password=sss;datasource=sds;initial catalog=fgf"

/*connection string give all details about database
connection initial catalog means data base name and data
source is sqlserver name,user id and password also*/

//open connection and pass connection string

sqlcon=new sqlconnection(constr)
sqlcon.open()

//create new object of command with new keyword

sqlcmd=new sqlcommand("select * from tablename",sqlcon)

/*data adapter is mediater between the data base and data
set because dataset is work in disconneted mode.*/

da=new sqldataadaptor(sqlcmd)

/*data adapter fetch query to data base and get answer and
fil the dataset using fill*/

da.fill(ds)

/*there is datagird which i use for display data on
form.data from dataset i use this bind to datagrid*/

datagird.datasource=ds.tables("table name")

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ado object model?

941


What is the use of Dataview?

1124


how you will deal result set? How do you sort a dataset?If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?

1002


How can we perform transactions in .net?

1054


What is the difference between Command and CommandBuilder object?

1219


Does entity framework use ado.net?

966


What is the procedure to call a Stored Procedure of Back End in ADO (ActiveX Data Object) and RDO (Remote Data Objects)?

1041


What do you mean by ‘batch updates’?

1040


What are the benefits of ADO.NET?

1117


What is datasource in ado.net?

1065


What do you know about ado.net's objects?

991


What is the use of SqlCommand object?

1219


What is difference between ado.net and asp net?

1033


Which method in OLEDBAdapter is used to populate dataset with records?

1018


What is the difference between DataReader and DataSet in ADO.NET?

1153