protected void Updatebtn_Click(object sender, EventArgs e) { using (DataClassDataContext db = new DataClassDataContext()) { foreach (SUPPLIER x in db.SUPPLIERs) { x.Status = x.Status * 1.1; db.SubmitChanges(); } } }
protected void Insert2_btn_Click(object sender, EventArgs e) { using (DataClassDataContext db = new DataClassDataContext()) { SHIPMENT newShipment = new SHIPMENT { Sno = "s4", Pno = "p2", Qty = 100, Price = .005 }; try { db.SHIPMENTs.InsertOnSubmit(newShipment); db.SubmitChanges(); Response.Write("<script>alert('Success') </script>"); } catch { Response.Write("<script>alert('Fail') </script>"); } } }