when i click the btn assign the error come out where go worng?
Private Sub btnAssign_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAssign.Click
ListBoxall.Items.Add(ListBoxassign.SelectedItem)
End Sub
(ArgumentNullExceotion was unhandld Value cannot be null.
Parameter name: item)
the admin the listbox done not show up which part go wong is it the code? i wan it like when come out this form it will auto show out the admin
Private Sub ListBoxassign_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBoxassign.SelectedIndexChanged
Dim conn As New System.Data.OleDb.OleDbConnection()
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\temp\Database1.accdb"
If conn.State = ConnectionState.Open Then conn.Close()
conn.Open()
Dim sql As String = "Select * From tbl_info where AdminNo"
Dim sqlCom As New System.Data.OleDb.OleDbCommand(sql, conn)
sqlCom.Connection = conn
Dim sqlReader As System.Data.OleDb.OleDbDataReader = sqlCom.ExecuteReader
While sqlReader.Read = True
ListBoxassign.Items.Add(sqlReader.Item("AdminNo").ToString)
End While
sqlReader.Close()
sqlCom.Dispose()
conn.Close()
Student_Form.Show()
End Sub