如何更新数字到数据库 [英] How do I update number to database
本文介绍了如何更新数字到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi
i有访问数据库和8字段
i不能通过vb.net将NUMBER数据类型更新到此数据库
错误:
hi
i have access data base and 8 field
i cant update NUMBER datatype to this db by vb.net
error :
Data type mismatch in criteria expression.
i尝试此代码:
i try this code :
com.CommandText = "UPDATE register SET price_reg=@price_reg,rprice_reg=@rprice_reg,ipprice_reg=@ipprice_reg,mprice_reg=@mprice_reg,totalp_reg=@totalp_reg,operatormali_reg=@operatormali_reg,noedaryaft_reg=@noedaryaft_reg,datedaryaft_reg=@datedaryaft_reg WHERE id_reg='" & Label58.Text & "' "
com.Parameters.AddWithValue("price_reg", TextBox12.Text)
com.Parameters.AddWithValue("rprice_reg", TextBox11.Text)
com.Parameters.AddWithValue("ipprice_reg", TextBox13.Text)
com.Parameters.AddWithValue("mprice_reg", TextBox14.Text)
com.Parameters.AddWithValue("totalp_reg", TextBox15.Text)
com.Parameters.AddWithValue("operatormali_reg", username)
com.Parameters.AddWithValue("noedaryaft_reg", ComboBox1.Text)
com.Parameters.AddWithValue("datedaryaft_reg", TextBox16.Text)
com.ExecuteNonQuery()
感谢您的回答
我尝试了什么:
i将我的发送参数方法更改为:
thanks for your answers
What I have tried:
i changed my send parameter method to :
com.Parameters.AddWithValue("price_reg", convert.toint32(TextBox12.Text))
推荐答案
这与如何更新查询的问题相同按数字数据类型 [ ^ ]。
这篇关于如何更新数字到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文