有时候会出现报错「'項目名’はテーブルに属していません」
排查原因:
①项目名写错>>>多用复制粘贴。手打易错。
②忘记设置DT>>>不写在Form_load处,易忘。写在DataRow赋值前,肯定不会忘。
例:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim tt As String
Dim tt2 As Date
Dim ii As Integer
If MsgBox("予約しますか", vbYesNo, "") = vbYes Then
Try
CM.CommandText = "Select * from dbo.reserves"
DA.SelectCommand = CM
DA.Fill(DS, "reserves"