Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Sequence to connect and retrieve data from database useig
dataset ?

Answer Posted / ramakrushna

SqlConnection con = new SqlConnection();
con.ConnectionString = "server=munapc;
database=project1; User ID=sa; Password=niit";
con.Open();

string query = "select * from emp";
SqlDataAdapter da = new SqlDataAdapter(query, con);
SqlCommandBuilder cmd = new SqlCommandBuilder(da);
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;

con.Close();

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how to call the sql commands asynchronously in ado.net version 2.0?

887


What is sqldatareader?

880


Explain the DataAdapter.Update() and DataSetAcceptChanges() methods.

949


What are all the classes that are available in System.Data Namespace?

963


What is executenonquery ado.net?

892


Explain the different row versions available in table?

982


What are the Features of a dataset

1191


Is datareader faster than datatable?

918


What is ole word?

897


What is the DataTableCollection?

1003


How can we perform transactions in .net?

1000


What are all components of ADO.Net data provider?

1010


What is an example of ordinal data?

1052


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

943


Explain the namespaces in which .net has the data functionality class.

1012