Asp.net 关键字';价值观';

Asp.net 关键字';价值观';,asp.net,Asp.net,这是我的代码。我想将这些值保存到数据库中。出现了一个错误 关键字值附近的语法不正确 用这个 com3.CommandText = "INSERT INTO BrandProperties(PropertyID,BrandID,Values) values('" + propertylabel.Text + "','" + B_id.Text + "','" + tb.Text + "')"; 而不是 com3.CommandText = "INSERT INTO BrandProperties

这是我的代码。我想将这些值保存到数据库中。出现了一个错误

关键字值附近的语法不正确

用这个

com3.CommandText = "INSERT INTO BrandProperties(PropertyID,BrandID,Values) values('" + propertylabel.Text + "','" + B_id.Text + "','" + tb.Text + "')";
而不是

com3.CommandText = "INSERT INTO BrandProperties(PropertyID,BrandID,Values) values(" + propertylabel.Text + "," + B_id.Text + "," + tb.Text + " ), con1";

这条线不应该是这样吗

        com3.CommandText = "INSERT INTO BrandProperties(PropertyID,BrandID,Values) values(" + propertylabel.Text + "," + B_id.Text + "," + tb.Text + ")";
请使用命令参数:

如果使用,则应指定带引号或括号的分隔标识符

使用括号的示例

com3.CommandText = "INSERT INTO BrandProperties(PropertyID,BrandID,[Values]) values(" + propertylabel.Text + "," + B_id.Text + "," + tb.Text + " ), con1";

插入列列表中的括号值,即
,[Values])
是否应该在文本属性周围加上“?例如,
(“+propertylabel.Text+”,”)
@alexw噢,很好,他在所有列中都缺少了它。@alexw:更正了,但错误相同occured@ASAWYER&ALEXW:THANKU.:)如果列为字符串类型,请立即重试。出现什么错误?能否在SQL查询中运行SQL命令,以找出确切的问题。
com3.CommandText = "INSERT INTO BrandProperties(PropertyID,BrandID,[Values]) values(" + propertylabel.Text + "," + B_id.Text + "," + tb.Text + " ), con1";