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

What are all the different methods under sqlcommand?

1029


What is ado asp?

1038


how to create a quiz software using 4 options to answer and how to check with answers in the database and award marks....

4526


What is meant by ‘transaction’ in a database and what are the ‘properties of transaction’?

1038


How do you update a dataset in ado.net?

1061


What providers does Ado.net uses?

1062


What is the DataTableCollection?

1097


What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?

1062


Which object of ado contains datarow datacolumn collection?

1012


What is difference between connected and disconnected architecture in ado.net?

1201


What are the major challenges in accessing data from a database?

1064


What is executequery?

992


What is connection string?

1053


What is the difference between ado.net and oledb?

1000


What is different between sqlcommand object and command behavior object?

1124