(I posted this in the Windows Forms Data Binding section, and they directed me somewhere else, and somewhere else directed me here.)
I have VS 2003. I'm using VB.NET to connect to a SQL database. When I fill the dataset, I only get 1 record returned.
I went thru the walkthrough in the Samples, and the connection to the Pubs database works fine. I did the same thing to a live database, and only get the one record returned, no matter what table I try to read.
The only difference I can see is that in the Pubs database, the author_id field has a data type of ID (VARCHAR). My live data has a key field with a data type of Varchar.
The code is pretty much straight out of the walkthrough sample, to the point that it's almost trivial.
Here's the Click_Show snippet:
Me.DataSet_FI_11.Clear()
Me.SqlDataAdapter1.Fill(DataSet_FI_11)
Call ShowPosition()
I used the wizard to set up the data adapter. Here's the Select command:
SELECT top 10 * FROM FI
I've modified the Select command several different ways, including having a where clause, not using the top 10 statement, and specifying field names instead of using the '*'. I've also re-created the form using a different table from the same database.
The only controls on the form are the Show, Prev, and Next buttons, the Position text box, and 3 text boxes bound to fields in the data set. The 3 text boxes display data as they should, and if I add a WHERE clause to the Select command, it will return a different record, but never more than 1.
I've also tried it using an OLEdbAdapter instead of the SQL Adapter, and still only get 1 record.
Any idea why I'm only getting 1 record?
Thanks,
Andy