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 does executequery return?

697


How to read data with the sqldatareader ?

731


Why do we need ado.net?

723


What is sqlconnection and sqlcommand?

710


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

745


What is the difference between oledb sql server and oledbdotnet provider?

724


How can we check that some changes have been made to dataset since it was loaded?

725


Does executenonquery return a value?

701


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

1804


What is Data Provider?

784


What is executequery?

685


Which control of the BindingNavigator returns the current position within the data source?

915


What are two types of transaction supported by ado.net?

739


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

1733


What does ado stand for in ado.net?

677