コード例 #1
0
        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)
            {
            }
        }
コード例 #2
0
        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)
            {
            }
        }
コード例 #3
0
        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";
        }
コード例 #4
0
        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();
        }
コード例 #5
0
 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);
 }