Sequence to connect and retrieve data from database useig
dataset ?

Answer Posted / ashokdahiya

We r talking about vb.net not c# codding
system.data
system.data.sqlclient

dim con,s as string
con="Server=servername;database=name;uid=sa;pwd=;"
s="Select * from tablename"
dim ad as new sqldataadapter(s,con)
dim ds as dataset
ad.fill(ds)
dim dv as dataview= new dataview(ds.tables("tablename"))
dv.sort="Name desc"
listbox.datasource=ds
listbox.displayMember="Name"&"Age"&"sex"...

it will work fine thanx!

Is This Answer Correct ?    2 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ado oledb and odbc?

705


Explain the overview of ado.net architecture?

718


Can we load multiple tables in a dataset?

823


What does executenonquery () method return?

704


What is microsoft ado.net?

819


How to copy the contents from one table to another table and how to delete the source table in ado.net?

770


How can we serialize the dataset object?

764


What is the significance of CommandBehavior.CloseConnection ?

871


Which components of a data provider is used to retrieve, insert, delete, or modify data in a data source?

909


Which method is used to sort the data in ADO.Net?

1764


Explain the difference between data reader and data adapter?

725


How do you update a dataset in ado.net and how do you update database through dataset?

707


What are the different layers of ado.net?

773


What is acid in ado.net?

740


What is the namespaces being used to access oracle database?

759