copy data from database using datagridview

Posted by Adnanumar under C# on 2/5/2013 | Points: 10 | Views : 1024 | Status : [Member] | Replies : 2
hello friends!
Please guaid me how should i copy the data from database using datagrid view?

adnan umar


Responses

Posted by: Satyapriyanayak on: 2/5/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
private void bindgrid()
{
OleDbConnection con = new OleDbConnection(ConnectionString);
con.Open();
str = "select * from student";
com = new OleDbCommand(str, con);
oledbda = new OleDbDataAdapter(com);
ds = new DataSet();
oledbda.Fill(ds, "student");
dataGridView1.DataMember = "student";
dataGridView1.DataSource = ds;
con.Close();

}

If this post helps you mark it as answer
Thanks

Adnanumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pavanandey on: 2/5/2013 [Member] Bronze | Points: 25

Up
0
Down
Are you trying to copy the data to some where or to display it in gridview



Thanks
Pavan Kumar
Mark Answer if this fits the need

Adnanumar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response