Dim sqlConn As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=G:\mymission2\mymission\mymission\mydatabase.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")
sqlConn.Open()
Dim adaptar As New SqlDataAdapter
Dim strSQL As String = "INSERT INTO 车辆信息表 (车辆编号,车辆牌照号,车型,标准座位数,出厂名称,发动机编号,投入运营日期,所属路队,功用) VALUES (" & TextBox1.Text & "," & TextBox2.Text & ",'" & ComboBox2.Text & "'," & TextBox4.Text & ",'" & TextBox5.Text & "'," & TextBox6.Text & ",'" & TextBox7.Text & "'," & TextBox8.Text & ",'" & ComboBox1.Text & "')"
Dim cmd As New SqlCommand(strSQL, sqlConn)
adaptar.SelectCommand = cmd
sqlConn.Close()
这样子可不可以更新数据库呢,我运行了,更新不起呢,各位帮看看是哪里的问题啊,不胜感激!