sqlconnection = new SqlCeConnection(ConnectionString);
sqlcommand = new SqlCeCommand();
sqlconnection.Open();
sqlcommand.Connection = sqlconnection;
sqlcommand.CommandText = (@"UPDATE ItemStock_Info SET Quantity =@qun WHERE [Item_Number]='"+ textBox1.Text +"'");
sqlcommand.Parameters.Add("@qun", qun);

Re: How to Reduce Qty from Stock Table when Sales qty using vb.net and sql 80 80

You're getting better. But when I work SQL problems like this I take the command and try it from my SQL command line. That way I can see if the syntax is right.

Re: How to Reduce Qty from Stock Table when Sales qty using vb.net and sql 80 80

Sql Command?

Re: How to Reduce Qty from Stock Table when Sales qty using vb.net and sql 80 80

Yes, M. Before you write an app to interact with a SQL server you would have learned to use a SQL command line to practice with.

Maybe you skipped an important tutorial or lesson?

Re: How to Reduce Qty from Stock Table when Sales qty using vb.net and sql 80 80

?? WHERE [Item_Number]='"+ textBox1.Text +"'"
Do it with parameter as you did about 'qun'.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.