本文介绍了插入数据以访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您好 我的功能是将数据从datagridveiw保存到Access数据库HelloI make function to save data from datagridveiw to Access data BasePrivate Function SD() Dim I As Integer For I = 0 To Me.DataGridView1.Rows.Count - 1 Me.VendorLongBillTableAdapter1.Insert(Me.DataGridView1.Item(0, I).Value, Me.DataGridView1.Item(1, I).Value, Me.DataGridView1.Item(2, I).Value, Val(Me.DataGridView1.Item(3, I).Value), Val(Me.DataGridView1.Item(5, I).Value), Val(Me.DataGridView1.Item(4, I).Value) * Val(Me.DataGridView1.Item(3, I).Value), Val(HowIPaid.Text), Val(HowStill), Me.DataGridView1.Item(7, I).Value, Convert.ToDateTime(Me.DataGridView1.Item(6, I).Value)) 'TODO: This line of code loads data into the 'RAFAADataSet.Prudects' table. You can move, or remove it, as needed. NextEnd Function 但是当我使用此功能时发生错误 参数''表达式''无法转换为''TextBox''' 其中是错误?but when I use this function error happenedArgument ''Expression'' cannot be converted to type ''TextBox''where is the error ?推荐答案看起来这是杯子:Looks like this is the cuplprit:Val(HowStill) 看起来 HowStill 是一个文本框控件。您可能需要这样做:It looks that HowStill is a textbox control. You might need to do:Val(HowStill.Text) 这篇关于插入数据以访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-23 03:06
查看更多