foreach (GridViewRow gvr in GridView1.Rows) { OleDbConnection cont = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; Data Source=path;Extended Properties=Excel 8.0;"); OleDbCommand cmd1 = new OleDbCommand("insert into [loadtogrid] (name,dept) values ('" + gvr.Cells[0].Text + "','" + gvr.Cells[2].Text + "')", cont); cont.Open(); cmd1.ExecuteNonQuery(); cont.Close(); }
"provider=Microsoft.Jet.OLEDB.4.0; Data Source=\"" +path+"\";Extended Properties=Excel 8.0;"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)