Vignesh siva

Vignesh siva

  • NA
  • 1
  • 649

how to edit the details list in grid view ?

May 24 2016 7:57 AM
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
//SqlConnection con = new SqlConnection("Data Source=SIVA-PC\\SQLEXPRESS;Initial Catalog=bookshop;Integrated Security=True");
//con.Open();
//string s = ("select * from Bookshop");
//SqlDataAdapter da = new SqlDataAdapter(s, con);
//DataSet ds = new DataSet();
//da.Fill(ds,"b");
//dataGridView1.DataSource = ds.Tables["b"];
//dataGridView1.DataMember = "Bookshop";
//con.Close();
}
private void BookList_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'bookshopDataSet.Bookshop' table. You can move, or remove it, as needed.
this.bookshopTableAdapter.Fill(this.bookshopDataSet.Bookshop);
}
private void btnsave_Click(object sender, EventArgs e)
{
}
private void btnedit_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=SIVA-PC\\SQLEXPRESS;Initial Catalog=bookshop;Integrated Security=True");
con.Open();
string s = ("select * from Bookshop");
SqlDataAdapter da = new SqlDataAdapter(s, con);
DataSet ds = new DataSet();
da.Fill(ds, "b");
dataGridView1.DataSource = ds.Tables["b"];
}
}
}

Answers (1)