:: problem in UPDATE statement ::
-
I want to do something like below(in ASP.NET & C#): string strupdate = "UPDATE table SET field = field + intvariable WHERE otherfield = yes"; but i don't know how i can do (add a variable value to a numerical field in a ACCESS database). Please give me the right string.
-
I want to do something like below(in ASP.NET & C#): string strupdate = "UPDATE table SET field = field + intvariable WHERE otherfield = yes"; but i don't know how i can do (add a variable value to a numerical field in a ACCESS database). Please give me the right string.
here is a sample code: int id=17; SqlConnection conn=new SqlConnection("initial catalog=Persons;user id=sa"); SqlCommand cmd=conn.CreateCommand(); cmd.CommandText="Update Catalog Set price=price*2 where id="+id.ToString(); cmd.CommandType=CommandType.Text; conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); the better way would be to call a stored procedure & pass parameters to it I hope it helps. Movaffaq bashi :-O il nome mio nessun sapra