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

What is the difference between Optimistic and Pessimistic locking?

548


What do you mean by ‘batch updates’?

513


Why is stored procedure used in ado.net?

549


What is ado.net objects?

523


What is a string variable?

490






What is sqldatareader in ado.net?

505


how we can fire event in databound coulm in datagfrid withot using button?

575


What Is Difference Between Ado And Ado.net?

562


What is variable view?

497


What is ado full form?

506


What are the 3 major types of connection objects in ado.net?

543


Explain executenonquery?

558


Is datareader faster than datatable?

543


If a table contains 20000 records. In a page at each time 100 records to be displayed.

522


What is executenonquery ado.net?

499