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

Answer Posted / manumole

SqlConnection conn = new SqlConnection("Data
Source=MYSERVER;Initial Catalog=Northwind;User
Id=sa;Password=sa;");
conn.Open();
DataTable dt=new DataTable();
SqlDataAdapter da = new SqlDataAdapter("select
* from Employees", conn);
da.Fill(dt);
testGV.DataSource = dt;

Is This Answer Correct ?    15 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the ado.net components?

528


What are the parameters that control most of connection pooling behaviours?

575


What are the methods of XML dataset object?

615


can we create synonymn in ms access,sql server,my sql if so explain me with example

1583


oledbdataadpter with ms access in c#.net giving exception System.Data.OleDb.OleDbException while writing adapter.update(dataset,"tabname"); how to update the database from dataset?

1931






What is a data control clerk?

574


What is execute scalar in ado.net?

502


How to create data relations?

550


How to enable and disable connection pooling?

511


What is the use of SqlCommandBuilder?

622


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

560


Can we create Synonymns in MS Acess,My Sql Server,Sql Server? But iam we can create in oracle!

1640


What are the advantages of using datalist?

511


What is meant by executenonquery?

529


What are the advantages using ado.net?

537