HOW TO FILL GRID VIEW WITH OUT USING SQLDATASOURCE AND
PROGRAMING?

Answer Posted / sai_sanju84@yahoo.com

we can fill grid view by using sqldataadapter and dataset.
the code will be as follows........

using System.data.sqlclient (add namespace)

in code part....

sqlconnection con=new sqlconnection("server=(the server
which u use);database=(database in which your table
located);user id=;password=");

sqldataadapter da=new sqldataadapter("select * from
table",con);
dataset ds=new dataset();
da.fill(ds);
gridview1.datasourse=ds;
gridview1.databind();

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the role of data provider in ado.net? What is the role of data provider in ado.net?

736


How can we load multiple tables in to dataset?

787


What are the advantages using ado.net?

727


How to add a check box or a dropdown list to a column in a datagrid?

719


What is a data control clerk?

760


What are the benefits of using ado.net?

700


What is the difference between executequery and executenonquery?

692


How to check if a datareader is closed or opened? IsClosed()

764


What is aggregate root?

715


How can we add relation between tables in a dataset?

734


What is Data Provider?

784


What is meant by executenonquery?

704


What is the full form of ado?

674


What is method to get XML and schema from Dataset? getXML() and get Schema ()

747


Define data adapter?

687