如何将表达式付给数据库字段,
如:a = Convert.ToInt32(jhshuliang.Text) * Convert.ToInt32(danjia.Text);SqlCommand comm1 = new SqlCommand("insert into purchaselist (grandtotal) values (a)", conn);
这样写对吗?
错误提示:在此上下文中不允许使用 'a'。此处只允许使用常量、表达式或变量。不允许使用列名。
2008-04-22 20:44