private void button4_Click(object sender, EventArgs e)
private void button4_Click(object sender, EventArgs e)
{
{
DataSet d = new DataSet();
DataTable dt = new DataTable();
// add the columns to the datatable
//if (dataGridView4.Rows.Count!=null)
//{
for (int i = 0; i < dataGridView4.Rows.Count-1; i++)
{
//for (int j = 0; j < dataGridView4.Columns.Count; i++)
//{
//for (int i = 0; i < dataGridView4.HeaderRow.Cells.Count; i++)
//{
dt.Rows.Add(dataGridView4.Rows[i].Cells[0].Selected.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[1].Selected.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[2].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[3].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[13].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[18].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[19].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[21].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[22].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[23].Value.ToString());
da = new OleDbDataAdapter();
da.Fill(d, "dt");
}
poonam tyagiPosted Aug 13, 2014, 2:07 AM
Dipankar BiswasPosted Aug 12, 2014, 10:50 AM