ADO.NET

ADO.NET Projects

ADO.NET Project 1

ADO.NET Examples

Examples

Copy a DataTable
Previous Home Next

we can do copy of datatable with the help of copy();

private void button1_Click(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\\student.mdb");
con.Open();
OleDbCommand cmd =new OleDbCommand("select * from marks", con);
DataTable tb = new DataTable();
tb.Load(cmd.ExecuteReader(CommandBehavior.CloseConnection));
DataTable copytable = tb.Copy();
tb = null;
dataGridView1.DataSource = copytable;
}
Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: