Dim FName As String = txtFName.Text
Dim LName As String = txtLName.Text
Dim ADD1 As String = txtADD1.Text
Dim ADD2 As String = txtADD2.Text
Dim ADDC As String = txtADDCITY.Text
Dim ADDPC As String = txtADDPC.Text
Dim TEL As String = txtTel.Text
Dim EMAIL As String = txtEmail.Text
If FName = "" Or LName = "" Or ADD1 = "" Or ADD2 = "" Or ADDC = "" Or ADDPC = "" Or TEL = "" Or EMAIL = "" = "" Then
MsgBox("You haven't entered data into each field, double check and try again.", MsgBoxStyle.Exclamation)
Else
connString = provider & datafile
con.ConnectionString = connString
con.Open()
sqlstatement = "INSERT INTO CustomerInfo(FirstName, LastName, addressLine1, addressLine2, City, Postcode, PhoneNum, EmailAddress,) VALUES ('" & FName & "','" & LName & "','" & ADD1 & "','" & ADD2 & "','" & ADDC & "','" & ADDPC & "','" & TEL & "','" & EMAIL & "',')"
da = New OleDb.OleDbDataAdapter(sqlstatement, con)
da.Fill(ds, "ADDNew")
con.Close()
MsgBox(FName & " " & LName & " has now been added to the database.", MsgBoxStyle.Information)
Me.Close()
End If
私は助けが必要です。このシステムを使ってデータベースにユーザーを追加しようとしていますが、入力された情報を検証しようとすると、このエラーが発生します。Conversion from string "" to type 'Boolean' is not valid
文字列 ""からタイプ 'ブール'への変換が無効です - データベースにユーザーを追加