将数据从VB.net插入到MS Access数据库表时出错

时间:2016-07-16 11:48:05

标签: vb.net ms-access-2007

当我尝试将数据从VB.net插入MS Access数据库表时出现问题。我的代码是:

Try
            Dim d As New DBConnect
            Dim indx As Integer
            indx = DataGridView1.Rows.Count - 1
            d.Editdata(String.Format("INSERT INTO Client (ClientName, ClientAddress, ClientPhone, ClientCredit, ClientLastPay) values('{0}','{1}','{2}','{3}','{4}')", FlatTextBox1.Text, FlatTextBox2.Text, FlatTextBox3.Text, FlatTextBox4.Text, FlatTextBox5.Text))
            Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

通过调试错误在这一行:

d.Editdata(String.Format("INSERT INTO Client (ClientName, ClientAddress, ClientPhone, ClientCredit, ClientLastPay) values('{0}','{1}','{2}','{3}','{4}')", FlatTextBox1.Text, FlatTextBox2.Text, FlatTextBox3.Text, FlatTextBox4.Text, FlatTextBox5.Text))

错误图片: https://s31.postimg.org/ew7cxpfy3/Sans_titre.png

希望得到你的帮助?

0 个答案:

没有答案