插入数据以访问数据库 [英] insert data to access database

查看:86
本文介绍了插入数据以访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我的功能是将数据从datagridveiw保存到Access数据库





Hello
I make function to save data from datagridveiw to Access data Base


Private 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.
    Next
End Function





但是当我使用此功能时发生错误< br $>


参数''表达式''无法转换为''TextBox'''



其中是错误?



but when I use this function error happened

Argument ''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)


这篇关于插入数据以访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆