开发者

Error :No Value gven for more required parameters in vb.net

开发者 https://www.devze.com 2023-03-23 23:42 出处:网络
I have getting erro开发者_Python百科r while update the data to Access db from VB.NET. Which is shown \"No value given for more required parameters\". Here i have given the code what i have tried.....

I have getting erro开发者_Python百科r while update the data to Access db from VB.NET. Which is shown "No value given for more required parameters". Here i have given the code what i have tried.....

con.open()
dim a
dim cd as new oledb.oledbcommand
a="update inward set Quantity=" & textbox3.text & "Where tool_name=" & listbopx1.selectedItemm & ""
cd=new oledb.oledbcommand(a,con)
cd.ExecuteNonQuery()
con.close

Please help me to fix this, I need to know why it has happened.


I think a problem with quotes

a="update inward set Quantity=" & textbox3.text & "Where tool_name=" & listbopx1.selectedItemm & ""

should it not be

a="update inward set Quantity=" & textbox3.text & " Where tool_name='" & listbopx1.selectedItemm & "'"

and watch out for quotes in the string.

So my advice: use parameterized queries,

I added a link to see how to write parameters. Look at : Running a Query, getting a value, then update record in ASP.net (VB)

0

精彩评论

暂无评论...
验证码 换一张
取 消