how to use subtract operation in windows form applicaion
-
i am using this command in sql server it is executed.... /** update product set quantity= quantity - 10 where productname='sugar' ****/ but how to use same command in windows form app... please give me any idea about this..
Use a
SqlCommand
for the actual sql text, and use aSqlConnection
for the connection to the database. A simple search will reveal millions of hits on these topics. You need to use theExecuteNonQuery
method for your command.*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
-
i am using this command in sql server it is executed.... /** update product set quantity= quantity - 10 where productname='sugar' ****/ but how to use same command in windows form app... please give me any idea about this..
-
Use a
SqlCommand
for the actual sql text, and use aSqlConnection
for the connection to the database. A simple search will reveal millions of hits on these topics. You need to use theExecuteNonQuery
method for your command.*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
-
Univote countered.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
-
Univote countered.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington
"Mind bleach! Send me mind bleach!" - Nagy Vilmos
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier
-
i am using this command in sql server it is executed.... /** update product set quantity= quantity - 10 where productname='sugar' ****/ but how to use same command in windows form app... please give me any idea about this..
Dear, May be you need something like below code..
protected void UpdateData()
{
int intQuantity = 0;
SqlConnection con = new SqlConnection("Your Connectionstring here");
SqlCommand cmd = new SqlCommand("update product set quantity=@Quantity where productname=@Product", con); ;
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@Quantity", intQuantity - 10);
cmd.Parameters.AddWithValue("@Product", "Sugar");
cmd.ExecuteNonQuery();
}KiranKumar Roy