Sub filllist()
strsql = "select * from tabletest"
ListView1.Items.Clear()
sqlcmd.CommandText = strsql
sqlcmd.Connection = sqlconn
sqldr = sqlcmd.ExecuteReader()
sqlda.SelectCommand = sqlcmd -- the error is pointing here and it say NullReferenceException was handled then Object reference not set to an instance of an object. How do i solve this?
I'm trying to view in the listbox if the data i enter did store in my sql server. please help.
While (sqldr.Read())
With ListView1.Items.Add(sqldr("Id"))
.subitems.add(sqldr("Name"))
.subitems.add(sqldr("Adress"))
.subitems.add(sqldr("Age"))
End With
End While
sqldr.Close()
End Sub