Dataset question: having issues with specific tables

B

Brian

Hello -

Im new to ADO.NET so bear with me here.

I have an Access DB, simplified as follows:

TABLE Person
person_ID autonumber PK
last_name text
first_name text
person_type number FK


TABLE Person_Types
person_type number PK
person_type_desc text

The second table is just a Lookup table, in which I have all the
possible "person types". It has only 7 rows, while the person table
has several thousand.

My problem is as follows: When I create an OledbDataAdapter and
DataSEt on the Person_types table, no problems. THe dataset is
correctly populated. But, when I do the same on the Person table, I
get ZERO rows in the dataset. What gives here? Is there some sort of
primary key issue that Im missing here?

FWIW, Ive tested the adapter functionality on all the tables in my DB.
Everything is fine with the lookup tables, but all other tables give
me an empty dataset.

Please help me understand why this is happening!!!

THanks
Brian
 
B

Bernie Yaeger

Hi Brian,

Can you post the code - shouldn't run too long, just two calls to open and
populate two datasets. I'm sure one of us will spot the error.

Bernie Yaeger
 
B

Brian Lappin

Hmmm...code? Well, that's really the problem. Im trying to use these
lovely MS wizards to create the DataAdapters and DataSets. Where is the
code?

Overall, Im not impressed with this while ADO data adapter framework.
Seems like I need to recreate my entire database schema on the clients
side. What happens if I change the root DB schema? Obviously all my
adapters will be broken. Not very robust.
 
B

Bernie Yaeger

Hi Brian,

Try working without the wizards.

Try something like this:
Dim dabranches As New SqlDataAdapter("select * from branches order by
imcacct", oconn)

Dim dsbranches As New DataSet("branches")

dabranches.Fill(dsbranches, "branches")

Dim daprod As New SqlDataAdapter("select * from prod order by bipad,
issuecode", oconn)

Dim dsprod As New DataSet("prod")

daprod.Fill(dsprod, "prod")



HTH,

Bernie Yaeger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top