VB SQL Help

  • Thread starter Thread starter Brett Baisley
  • Start date Start date
B

Brett Baisley

Its been a while since I used VB and I'm new to VB.net. I set up an
sqlConnection, sqlCommand and sqlDataAdapter (by dragging the controls to
the form) to query a local database. I set up a text box to display the
length of the sqldataadapter by doing this:
sqldataadapter.defaultsourcetablename.length and it returns 5 (which is
correct, there should be 5 records in there).

The query should return the ArtistName and AlbumName fields.

What I can't figure out is how to add each record to a listbox? I know its
listbox1.items.add(...) but what do I call? I want to store ArtistName in
one list box and AlbumName in the other.

Can someone finish this off for me? Thanks!

Brett
 
Hi Brett,

Did you configure the dataadapter and make afterwards a dataset?

You do that by rigthclicking on the dataadapter icoon that is situated below
in your form.

It sounds not, because I hear you not talking about the dataset and that is
used in the way you are using to get the information.
I set up an sqlConnection, sqlCommand and sqlDataAdapter (by dragging the
controls >to the form) to query a local database. I set up a text box to
display the
length of the sqldataadapter by doing this:
sqldataadapter.defaultsourcetablename.length and it returns 5 (which is
correct, there should be 5 records in there).

I hope this helps you a little bit.

Cor
 
No, I don't have a dataset. I'll look into that and if I still have
problems, I'll get back to you. Thanks!
 
Very good Brett,

But it is a totaly different approach, there are so many ways you can do
things with VB.net

Cor
 
Back
Top