0
我正在使用Access数据库和vb.net 2010.我在数据库中创建了一个表,其中包含title,datein,dateout和roomnymber列。在vb.net 2010我做了一个杰出的标题=组合框,datein和dateout = DateTimePicker。当我点击F5时,会发生错误:INSERT INTO语句错误在语句中。这里是我的代码:如何从vb.net存储数据以访问数据库
Dim sql As String
sql = "INSERT INTO tcekin(title,firstname,lastname,address,country,company,roomnumber,datein,dateout,rommtype,note)" & "VALUES('" & ComboBox1.Text & _
"','" & txtFirstName.Text & "','" & txtLastName.Text & "','" & txtAddress.Text & "','" & cboCountry.Text & "','" & txtCompany.Text & "','" & txtNumber.Text & _
"','" & dptDateIn.Text & "','" & dptDateOut.Text & "','" & cboRoom.Text & "','" & txtNotes.Text & "')"
cmmd = New OleDbCommand(sql, cnn)
请只有英文。我会马上提供一份谷歌翻译,甚至可能会手动编辑内容,但通过编辑问题以用您自己的语言用英语提问,您可能会做得更好。 – 2010-11-28 04:26:44
owgh ..因为我的英文破碎^^ – existsman 2010-11-28 05:29:48