返回首页

目前我使用ASP.NET开发Web应用程序。但我无法插入数据到database.Any示例代码可以提供吗?

Dim constring As String = "Data Source = USER-PC\SQLEXPRESS; Initial catalog = PatientDiagnose; Persist Security Info= True; User ID = Thalassemia; Password = Ling123!@#"

Dim con As SqlConnection = New SqlConnection(constring)

Dim ds As New DataSet

Dim adapter As New SqlDataAdapter

 con.Open()

Dim insertCommand As String = "Insert into DoctorRecord (DocFirst,DocLast) values ('  " & TextBoxFirst.Text & ", " & TextBoxLast.Text & "')"

adapter.SelectCommand = New SqlCommand(insertCommand, con)

adapter.Fill(ds)

 



Error: There are more columns in the INSERT statement than the values specified in the VALUES clause.
| HL22 | Dorababu743

回答

评论会员: 时间:2
|