我在此代码中遇到了错误...帮助我 [英] I Got an error with this code...Help me
本文介绍了我在此代码中遇到了错误...帮助我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个错误:-
INSERT INTO语句中的语法错误
使用以下代码:-
i got an error :--
Syntax error in INSERT INTO statement
with following code:--
sub Submit_Contact_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim nm = Request("textbox1")
Dim cn = Request("textbox2")
Dim em = Request("textbox3")
Dim msg = Request("textbox4")
ds=new DataSet()
dbcomm=New OleDbCommand("Insert * INTO contact VALUES(1+'"+nm+"','"+cn+"','"+em+"','"+msg+"')",dbconn)
dbconn.Open()
dbcomm.ExecuteNonQuery()
dbadp = New OleDbDataAdapter(dbcomm)
dbconn.close()
dbadp.fill(ds)
end sub
请帮帮我...!
please help me...!
推荐答案
插入后不能跟"*".插入语法:
Hi,
Insert can not be followed by ''*''. Insert syntax:
INSERT INTO table_name
VALUES (value1, value2, value3,...)
INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...)
欢呼声
Cheers
我告诉过你不要使用字符串连接: ^ ].
您真的不应该这样做.而且您不应该重新发布问题.请不要.
—SA
I told you not to use string concatenation: I have Got an error with insert query...Help me[^].
You really should not do it. And you should not re-post the questions. Please don''t.
—SA
这篇关于我在此代码中遇到了错误...帮助我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文