Example #1
0
 //Method implemented on direct button click
 protected void DelBut_Click(object sender, EventArgs e)
 {
     using (LinqClassDataContext delete = new LinqClassDataContext())
     {
         ProTab1 delvalue = delete.ProTab1s.SingleOrDefault(value => value.LName == "lorry");
         delete.ProTab1s.DeleteOnSubmit(delvalue);
         delete.SubmitChanges();
         GetData();
     }
 }
Example #2
0
 //Method storage area
 //Method to update the table
 private void UpdateMethod()
 {
     using (LinqClassDataContext update = new LinqClassDataContext())
     {
         ProTab1 insMet = update.ProTab1s.SingleOrDefault(value => value.LName == UpdOldLName.Text);
         insMet.LName = UpdNewLName.Text.ToString();
         update.SubmitChanges();
         GetData();
     }
 }
Example #3
0
 //Method contains Code for insertion
 private void InsertData()
 {
     using (LinqClassDataContext context = new LinqClassDataContext())
     {
         ProTab1 instab = new ProTab1
         {
             Name  = TextBox1.Text.ToString(),
             LName = TextBox2.Text.ToString()
         };
         context.ProTab1s.InsertOnSubmit(instab);
         context.SubmitChanges();
         GetData();
     }
 }
Example #4
0
 partial void DeleteProTab1(ProTab1 instance);
Example #5
0
 partial void UpdateProTab1(ProTab1 instance);
Example #6
0
 partial void InsertProTab1(ProTab1 instance);