D
Dmension
Dmension said:Here is a snippet of my code. At "SDA.SelectCommand.CommandText = "Select
(*) FROM Badge " I get an error message that says "Additional information:
Object reference not set to an instance of an object"
Any help would be appreciated..
Private Sub btnfill_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnfill.Click
'Dim Waitfrm As New frmPerload
Dim SDA As New SqlDataAdapter
Dim SCN As New SqlConnection
Dim SDS As New DataSet
'Waitfrm.Show()
'System.Threading.Thread.Sleep(5000)
'Waitfrm.Close()
SDS.Clear()
SbarPanel1.Text = "Loading Personnel"
SCN.ConnectionString = ("Persist Security Info=False;User
ID=cic;Password=cic;Initial Catalog=AG30000;Data Source=ENGSQEG246A;")
SCN.Open()
MessageBox.Show("connection is open")
SDA.SelectCommand.CommandText = "Select (*) FROM Badge "
SDA.SelectCommand.Connection = SCN
SDA.Fill(SDS)
lstBoxPersonnel.DataSource = SDS
lstBoxPersonnel.DisplayMember = "Badge"
SbarPanel2.Text = "Number of Records" +
(SDS.Tables(0).Rows.Count.ToString)
'SCN.Close()'
End Sub