plz help me......
cmd.CommandText = "update item_creation set item_name='" + txtIname.Text + "',item_code='" + txtIcode.Text + "',item_group='" + cmbUgroup.Text + "',unit='" + cmbUnit.Text + "',Sale_price='" + txtsprice.Text + "',Pur_price='" + txtP_price.Text + "',MRP_price='" + txtMrp.Text + "',Self_Price='" + txtScost.Text + "',Comments='" + txtComments.Text + "',currency='" +cmbPgroup.Text + "' where item_name='" + name.ToString() + "'";
please help me to find the syntax error in this statement.i am sitting with this for several hours.but i cant get it.....its urgent....plz........
Loading
Soumya SurendranPosted Sep 30, 2009, 2:17 AM
cmd.CommandText = "update item_creation set [item_name]='" + txtIname.Text + "',[item_code]='" + txtIcode.Text + "',[item_group]='" + cmbUgroup.Text + "',[unit]='" + cmbUnit.Text + "',[Sale_price]='" + txtsprice.Text + "',[Pur_price]='" + txtP_price.Text + "',[MRP_price]='" + txtMrp.Text + "',[Self_Price]='" + txtScost.Text + "',[Comments]='" + txtComments.Text + "',[currency]='" +cmbPgroup.Text + "' where [item_name]='" + name.ToString() + "'";
Resmy RaviPosted Sep 30, 2009, 2:33 AM
thanks...its working....
Dushan StankovicPosted Sep 28, 2009, 4:14 AM
Well, my friend, fields in the table witch is string type (nvarchar[], varchar[], text) must be into ' ' ('value'), but number fields dosn't need ' ' and looks like this:
"Pur_price=" + txtP_price.Text
look quotas!
You code telling me that all fields in table in db have string type.