I have one query in trigger plz give me reply as soon as possible
below is my table and insert code
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
thera are 2 tables
1-product
2-item
product fields
-Item Name
-Size
-Purchase
-Available
-Balance
item Fields
Item_Name
Size
Stock
________________
As soon as we enter record in product fields stock will increase automatically in item table
For Example
Product Table Item TAble
-Item Name Bag Bag
-Size 3 3
-Purchase 10
-Available 10
-Balance 20 Stock 20
As soon as we insert second record in bag and product table balance is now 20+10=30 than that 30 will be upadted in tiem table in stock =30
my insert code is as below
------------------------------------------------------------------------------------------------------------
SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=F:\New_Project\App_Data\Database.mdf;Integrated Security=True;User Instance=True");
con.Open();
SqlCommand cmd = new SqlCommand("insert into product values('" + TextBox1.Text + "','" + TextBox2.Text + "'," + TextBox3.Text + ",'" + TextBox4.Text + "','" + TextBox5.Text + "')", con);
cmd.ExecuteNonQuery();
ClientScript.RegisterStartupScript(Page.GetType(), "Submit", "<script language='javascript'>alert('Data is Saved.....!!!')</script>");
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
con.Close();
GridView1.DataBind();