protected void Button1_Click(object sender, EventArgs e) { using (var db = new AGRODataContext(Server.MapPath("\\"))) { Animals a = new Animals { AName = TextBox1.Text, MarketPrice = Convert.ToDouble(TextBox2.Text), Count = Convert.ToInt32(TextBox3.Text) }; db.Animals.InsertOnSubmit(a); try { db.SubmitChanges(); BindGrid(); } catch (Exception exception) { Debug.WriteLine($"Somethig wrong: {exception.Message}"); } } }
partial void UpdateAnimals(Animals instance);
partial void DeleteAnimals(Animals instance);
partial void InsertAnimals(Animals instance);