public void Update(RepTr r) { try { using (SqlConnection conn = new SqlConnection(connectedstring)) { conn.Open(); SqlCommand command = new SqlCommand(); command.CommandText = "upd1"; command.CommandType = CommandType.StoredProcedure; command.Connection = conn; command.Parameters.AddWithValue("@tid", r.tid); command.Parameters.AddWithValue("@techdomain", r.techdomain); SqlDataAdapter sda = new SqlDataAdapter(command); sda.Fill(ds); sda.Update(ds); } } catch (Exception e) { } }
public void Insert(RepTr r) { try { using (SqlConnection con = new SqlConnection(connectedstring)) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "sel"; cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con; cmd.Parameters.AddWithValue("@tid", r.tid); cmd.Parameters.AddWithValue("@tname", r.tname); cmd.Parameters.AddWithValue("@location", r.location); cmd.Parameters.AddWithValue("@techdomain", r.techdomain); cmd.Parameters.AddWithValue("@startdate", r.startdate); SqlDataAdapter sd = new SqlDataAdapter(cmd); sd.Fill(ds); sd.Update(ds); } } catch (Exception e) { } }
protected void Buttonupd1(object sender, EventArgs e) { RepTr r = new RepTr(); r.tid = int.Parse(tidu.Text); r.tname = nameu.Text; TraineeDataLayer tdl = new TraineeDataLayer(); tdl.Update(r); temp.Text = "Updated Successfully"; }
protected void Buttonsp(object sender, EventArgs e) { RepTr r = new RepTr(); r.tid = int.Parse(tidp.Text); TraineeDataLayer tdl = new TraineeDataLayer(); var l = tdl.GetparData(r); GridView2.DataSource = l; GridView2.DataBind(); }
public DataSet GetparData(RepTr r) { try { using (SqlConnection con = new SqlConnection(connectedstring)) { con.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "selpar"; cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con; cmd.Parameters.AddWithValue("@tid", r.tid); SqlDataAdapter sd = new SqlDataAdapter(cmd); sd.Fill(ds); sd.Update(ds); } } catch { } return(ds); }