Merging data from 2 connections into a datagrid

  • Thread starter Al Adolfsen via .NET 247
  • Start date
A

Al Adolfsen via .NET 247

(Type your message here)
Hi. Hope someone can help me. I am trying to merge data fromtwo separate ACCESS 2000 mdb's into a data grid. I've set up 2data adapters, 2 data sets. I try to merge the two dataset soas to use a bound datagrid to display the data. All the data isto be displayed on the same datagrid line. I cannot seem toget the data merged.

Table 1 (dsEquip1)
Equip No. 6 chars
Description 20 char
Job No. 6 chars (Foreign Key)
Field....
......
(No primary key although the equipno is not duplicated

Table 2 (dsJobs1)
Job No. 6 chars (Primary Key)
Job Name: 30 chars
Job Address: 30 chars
Job County: 15 chars
.....
..
The main display is the equipment because multiple equipment on ajob site

I fill the datasets as thus:
daEquip.fill (dsEquip1)
daJobs.Fill (dsJobs1)

Then try merging:
dsEquip1.Merge (dsJob1,true,True, MissingSchemaAction.Add)
dsEquip1.AcceptChanges()

When the form loads and the data displayed, I do not get the datafrom the jobs dataset. I've even tried to dummy the equipmentwith empty spaces for the receiving info (so as to bound theform correctly), but the job data still does not display.

What Am I Doing Wrong?

Al Adolfsen
 
G

Gerry

If I understand your needs correctly, here is what I would do.

Look at the DataGridTableStyles object in MSDN for help with this if it is
not clear how to use it.

Create a DataGridTableStyle object, adding the necessary GridTextBoxColumns
to the table style. Format the GridTextBoxColumns as needed and then add
them to the data grid.

You can use the data from multiple datasets for this so the merge is not
that difficult.

Gerry




(Type your message here)
Hi. Hope someone can help me. I am trying to merge data from two separate
ACCESS 2000 mdb's into a data grid. I've set up 2 data adapters, 2 data
sets. I try to merge the two dataset so as to use a bound datagrid to
display the data. All the data is to be displayed on the same datagrid line.
I cannot seem to get the data merged.

Table 1 (dsEquip1)
Equip No. 6 chars
Description 20 char
Job No. 6 chars (Foreign Key)
Field....
.......
(No primary key although the equipno is not duplicated

Table 2 (dsJobs1)
Job No. 6 chars (Primary Key)
Job Name: 30 chars
Job Address: 30 chars
Job County: 15 chars
......
...
The main display is the equipment because multiple equipment on a job site

I fill the datasets as thus:
daEquip.fill (dsEquip1)
daJobs.Fill (dsJobs1)

Then try merging:
dsEquip1.Merge (dsJob1,true,True, MissingSchemaAction.Add)
dsEquip1.AcceptChanges()

When the form loads and the data displayed, I do not get the data from the
jobs dataset. I've even tried to dummy the equipment with empty spaces for
the receiving info (so as to bound the form correctly), but the job data
still does not display.

What Am I Doing Wrong?

Al Adolfsen
 

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