473,799 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataSet / DataTable question

Hello NG !
I have a tricky question about dataSet and dataTable.
In my app I have 2 databases. In the first (called A1) database are the
whole datas but I'm interesting in one table tbl1 (with 20 attributes). To
communicate with the DB A1 I have a lib, which gives me a dataset of this
table tbl1 (with all attributes).

This dataset i would like to give the lib for my second DB A2. In this DB A2
is a table tbl2 which has just some of the attributes of tbl1 (tbl2 is like
a backup table for some attributes of A1.tbl1).
the lib for the A2 database should write all attributes from the dataset of
A1, which holds all attribues from A1.tbl1 into the database A2.tbl2, if the
attribute exists.

Now I would like to know, whats the best way for doing that. Can I use the
Fill-Methode or do I have to use a SQL-Statement (INSERT INTO tbl2 (att1,
att2, att2) select.....

Thanks for help
Regards
Marcel Hug
Dec 6 '05 #1
1 1268
You should be able to use the dataset merge metod, you need to use the ignore
enumerator to only add columns (attributes) from the A1 table into the A2
table.

e.g.

dataset2.Merge( dataset1, true, MissingSchemaAc tion.Ignore);

above dataset1 would be from A1 and dataset2 would be from A2

I hope this is the answer you are looking for.

Steven.

"Marcel Hug" wrote:
Hello NG !
I have a tricky question about dataSet and dataTable.
In my app I have 2 databases. In the first (called A1) database are the
whole datas but I'm interesting in one table tbl1 (with 20 attributes). To
communicate with the DB A1 I have a lib, which gives me a dataset of this
table tbl1 (with all attributes).

This dataset i would like to give the lib for my second DB A2. In this DB A2
is a table tbl2 which has just some of the attributes of tbl1 (tbl2 is like
a backup table for some attributes of A1.tbl1).
the lib for the A2 database should write all attributes from the dataset of
A1, which holds all attribues from A1.tbl1 into the database A2.tbl2, if the
attribute exists.

Now I would like to know, whats the best way for doing that. Can I use the
Fill-Methode or do I have to use a SQL-Statement (INSERT INTO tbl2 (att1,
att2, att2) select.....

Thanks for help
Regards
Marcel Hug

Dec 6 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
13058
by: JS | last post by:
I'm trying to create a data layer and having problems returning a DataSet from my code that's in a class module. Please forgive me. I'm new to C# (VB'er). I decided to create my data layer in small steps. Right now, I'm just trying to attach a ComboBox to a dataset that's in my class module. In the class, I call a Stored Procedure. I know how to set up the connection, command, adapter, and dataset, what I'm having a problem with is,...
7
2209
by: Jason Huang | last post by:
Hi, The SQL string is "select * from Customer where 0 > 1", and the DataSet should be null. Why MyDataSet.Tables.Count is 1, not 0? What kind of DataTable in this place? Thanks for help. Jason
15
2251
by: JIM.H. | last post by:
Hello, Can I send a dataset as a parameter into stored procedure and import data to a table in the stored procedure? Thanks, Jim.
2
3702
by: Carl Summers | last post by:
I have a table in an Access database that has no sort applied in Access. When I fill a dataset with data from that table (the entire one dimensional table) my dataset is sorted differently than the database. This would not be a problem, and really isn't a problem except that it means I have to search the dataset each time I want to find a particular record instead of just storing a variable. Which brings me to a different question....
17
2771
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only allow user to filter the first time, when they tried the second time, the speficied cast error message will prompt one.... I create a mydataset1 first, and the mydataset1 data source was getting from DataGrid.DataSource.
12
23770
by: Marc | last post by:
I have used XMLDataToString = DataSetForXML.GetXml() to get an XML string from a dataset. I am looking for a way to create a dataset from this XML string. I tried DataSetForXML.ReadXml(XMLDataToString) but I received error messages. Does anyone know how to do this without creating a file (disk copy) of this XML data? Thanks for your help. Marc
8
1152
by: John | last post by:
Hi I have a sub method that has been passed a dataset as parameter. I need to insert this dataset into a table. What is the code that I need to do this? The dataset does not have any conflicting keys so it is a very easy scenario from conflict resolution point of view. Thanks Regards
4
1444
by: Robert Bravery | last post by:
Hi All, I'm New to VS.net. Trying to figure out this new dataset thingy. Ok so I add a dataadapter with all the correct properties for a table. Then generate the dataset. Now open the dataset and drag another table from the server explorer, set up some relations there. Set up two grids, one a s a parent one as a chgild. Fill the dataset, run the form But my child grid never gets any records. I then added another datadapter for the child...
7
2092
by: =?Utf-8?B?QWxla3MgS2xleW4=?= | last post by:
I use in my asp.net code dataset and populate datatable using dataadapter. The problem is that my code demand huge amount of memory and I am looking for way reduce this demand. At this time I keep links to dataset, dataadapter and datatable in session. As I understand datatable is class and specific datatable does not belong directly to dataset and using the same dataadapter I can populate two datatables different way from the same...
3
2847
by: Ken Fine | last post by:
This is a question that someone familiar with ASP.NET and ADO.NET DataSets and DataTables should be able to answer fairly easily. The basic question is how I can efficiently match data from one dataset to data in a second dataset, using a common key. I will first describe the problem in words and then I will show my code, which has most of the solution done already. I have built an ASP.NET that queries an Index Server and returns a...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9543
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10488
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7567
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6808
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.