Re: Join DataTables in same dataset

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks for the reply, I won't need to "unmerge" the data later. The Excel
sheet has all the contacts that currently reside in the DB plus new ones.
All I want to do is take the new customers and append to the database in
access.

Seems simple I want to take data from a DataTable and put it into an
existing access table. Even if i do merge the data in the c# project i
still have to get the dataset to update back to the database.



"ssamuel" <ssamuel@xxxxxxxxx> wrote in message
news:1163536573.312271.141340@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Don,

As far as the framework is concerned, any two given DataTable objects
have different schemas. Even if they look the same to you, they're not
to the framework.

Your best bet here is probably to Merge() one DataTable into the other.
The Merge() process will deal with the issues like, "what if the
schemas are different," or, "what if the columns are in a different
order," and give you fine-grained control of how to deal with that. If
your assumption that the schemas are identical is correct, you'll get
no exceptions.

Once the data is merged, you'll have to separate what goes where. It
may be useful to add a source column (pre-merge) to each table that
contains a static value based on where it came from. Then it's much
easier to un-munge later.


Stephan


don wrote:
I have written a program to hold a sales contact db. It is written in c#
express.

an update is sent from head office in xl format, i need to import only
the
new rows to an access database.

I have gotten this far:

a separate OleDbconnection to each source, which reads the entire data
source (select *) into the same dataset, but different tables.

from here i want to be able to pull the new rows from the xl table and
append it to the access table.

When I try to create a relation between the two table it says "This
constraint cannot be enabled as not all values have corresponding parent
values."
*******************************************************************************************************************
DataColumn parentColumn =
accessdata.Tables["gnwestcustomers"].Columns["Customer Number"];

DataColumn childColumn = accessdata.Tables["Table"].Columns["Customer
Number"];

DataRelation relExcel;

relExcel = new DataRelation("RelateExcel", parentColumn, childColumn);


accessdata.Relations.Add(relExcel);



***************************************************************************************************************************************

I can do this all in MSAccess easily, but the user needs to be able to do
it
in the field....come on people sales person here.......not technically
enabled in the computer department if you know what i mean... :)



any help appreciated.



Thanks in advance.



.



Relevant Pages

  • Re: UDM and Star Schema
    ... and more complicated schemas. ... you create a cube. ... SSAS 2005 is able to create the tables for you, ... proactive caching can detect changes in the source database and then update ...
    (microsoft.public.sqlserver.datawarehouse)
  • Re: Mumps: the IT worlds best kept secret?
    ... No matter if that is enforced by the database software or by convention in ... Generally they do not use SQL as its not an appropriate or ... The reasons for Mumps databases to exist, are exactly what you pointed out ... Intuitively you would expect RDBMSs with strong and rich schemas would ...
    (comp.lang.mumps)
  • Abnormally large merge replication tables
    ... free space is around 10 mb for each database. ... I am running SQL Server 2000 w/SP3a on my publisher/distribution server. ... The MSDE machines move in and out of replication (they are on ... windiff between the schemas created by Enterprise Manager. ...
    (microsoft.public.sqlserver.replication)
  • Re: UDM and Star Schema
    ... SSAS 2005 like any other OLAP tool on the market can works with flat schemas and more complicated schemas. ... SSAS 2005 is able to create the tables for you, so instead of creating the tables in the database then creating the cube, you create your dimensions and cubes first and SSAS2005 will generates the tables for you. ...
    (microsoft.public.sqlserver.datawarehouse)
  • Re: Join DataTables in same dataset
    ... As far as the framework is concerned, any two given DataTable objects ... have different schemas. ... DataColumn parentColumn = ...
    (microsoft.public.dotnet.languages.csharp)