Crud
Crud
{
SqlConnection con;
public void Establishconnection()
{
string connectionstring = "Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=Student;Data Source=DESKTOP-B64FAB3\\SQLEXPRESS";
con = new SqlConnection();
con.ConnectionString = connectionstring;
if (con.State==ConnectionState.Closed)
{
con.Open();
}
("+txtid.Text+",N'"+txtname.Text+"',N'"+txtfname.Text+"',N'"+txtdep.Text+"','"+txtt
el.Text+"')";
txtid.Text = gv.Rows[e.RowIndex].Cells[0].Value.ToString();
txtname.Text=gv.Rows[e.RowIndex].Cells[1].Value.ToString();
txtfname.Text=gv.Rows[e.RowIndex].Cells[2].Value.ToString();
txtdep.Text=gv.Rows[e.RowIndex].Cells[3].Value.ToString();
txttel.Text = gv.Rows[e.RowIndex].Cells[4].Value.ToString();
}