I have a Button
that checks a ComboxBox
that has two values, namely Lec and Lab. I want to use the ComboBox
to determine what Form
I want to display a database table in. I keep getting an error in SQL
An unhandled exception of type 'System.NullReferenceException' occurred in System.Data.SQLite.dll
Additional information: Object reference not set to an instance of an object.
What is wrong with reading my database?
This is the Button
:
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Dim Checker As String
Dim Checker2 As String
Dim ClassIntl = TextBox1.Text
SeatPlanLab.TextBox1.Text = ClassIntl
SeatPlanCorner.TextBox1.Text = ClassIntl
SeatPlanNotCorner.TextBox1.Text = ClassIntl
Me.Hide()
Checker = ComboBox1.SelectedItem.ToString
'MessageBox.Show(Checker)
DBConn()
SQLSTR = "SELECT SeatPlan FROM MasterClasslist WHERE ClassID = '" & ClassIntl & "'"
readDB()
While (SQLDR.Read())
Checker2 = SQLDR("SeatPlan")
If Checker Is "Lab" Then
SeatPlanLab.Arrangement()
SeatPlanLab.Show()
Else
If Checker2 Is "corner" Then
SeatPlanCorner.Arrangement()
SeatPlanCorner.Show()
Else
SeatPlanNotCorner.Arrangement()
SeatPlanNotCorner.Show()
End If
End If
End While
SQLDR.Dispose()
SQLCONN.Close()
End Sub
Aucun commentaire:
Enregistrer un commentaire