473,396 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DATATable and INNERJOIN

Hello:

Is it possible to create a datatable that is an Inner Join of two existing
datatables in a Dataset. If so, how do you do so?

Thank You
Prasun

Nov 21 '05 #1
3 3252
Probably the best way to do this is to fill the original datatable with the
results of a Join statement. The short answer, as far as doing this
directly w/ two data tables is No. you can specify a datarelation - but if
values aren't present in the parent table, then a constraint will be
violated. AFAIK, the only way to get there other than pulling the joined
data into the table from the server is looping through everything and
building it yourself.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Prasun" <pr******@csufresno.edu> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hello:

Is it possible to create a datatable that is an Inner Join of two existing
datatables in a Dataset. If so, how do you do so?

Thank You
Prasun

Nov 21 '05 #2
Hello:

I totally messed up when asking the question.... Here is my problem
statement/ background

Background: My program reads an excel file and populates three datatables
depending on the value in one of the columns. Now when i create a
datarelation and try to combine the tables, I loose values that are unique
in the child tables. I want to make sure that even those values will get
transfered. Is there a way to go about this? That is why i was wondering if
there is a way i could program an OuterJoin, leftjoin or so. I could make
the two datatables, fill up excel sheets with that info and then start using
those table to make the outer join but wanted to make sure if there was an
easier way

All help would be appreciated,

Thank You
Prasun
"W.G. Ryan eMVP" <Wi*********@gmail.com> wrote in message
news:ev**************@TK2MSFTNGP10.phx.gbl...
Probably the best way to do this is to fill the original datatable with
the
results of a Join statement. The short answer, as far as doing this
directly w/ two data tables is No. you can specify a datarelation - but
if
values aren't present in the parent table, then a constraint will be
violated. AFAIK, the only way to get there other than pulling the joined
data into the table from the server is looping through everything and
building it yourself.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Prasun" <pr******@csufresno.edu> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Hello:

Is it possible to create a datatable that is an Inner Join of two
existing
datatables in a Dataset. If so, how do you do so?

Thank You
Prasun


Nov 21 '05 #3
You might also want to check out this web-site that promises to provide a
..NET component to allow full SQL syntax queries against a DataSet.

http://queryadataset.com

Hope this helps
Ad.
"Prasun" wrote:
Hello:

Is it possible to create a datatable that is an Inner Join of two existing
datatables in a Dataset. If so, how do you do so?

Thank You
Prasun

Nov 21 '05 #4

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

Similar topics

5
by: randy | last post by:
Hello all, I have a DataTable which I am building column by column and adding rows after each new column. The DataTable columns match the columns in my database table. I'm building the...
5
by: Stefan Turalski \(stic\) | last post by:
Hi, I'm wondering if there is a way to send a method parametrs by ref when DataTabel is a type of this value ? I done some sort of select over DataTable columns, just by removing them froma...
2
by: Newbie | last post by:
Im getting an exception: System.FormatException: Input string was not in a correct format. at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at...
1
by: TaeHo Yoo | last post by:
Hi all, After sorting and grouping data using a dataview, then how to transfer the changed datatable in the dataview to a datatable in C#? Cheers
0
by: Chris Ericoli | last post by:
Hi, I am working with an 'in session' ado dataset with an asp.net application. My dataset is comprised of two tables, one of which maintains a few calculated datacolumns. For some reason these...
7
by: Raymond Lewallen | last post by:
Which would be the proper way or the reason for using any of the following or combinations of the following? These are the 3 ways I've figured I can do what I want to do, I just don't know which...
3
by: Gene Hubert | last post by:
I'm using DataTable.ImportRow to move data from one datatable to another... Dim dt, dtTarget As DataTable Dim dr As DataRow dt = DirectCast(Me.DataSource, DataTable) dtTarget = dt.Clone...
0
by: Maart_newbie | last post by:
Hi all, I've got a question about returning the value of a pk-column to a DataTable after inserting a row (via a data-adapter) using MySql5. Here is the SQL and code concerned: ...
5
by: Frank Hauptlorenz | last post by:
Hello, I recognized some days ago, that returning a DataTable blocks my WCF-Service. Is this a known bug? If I add this table to a new DataSet() and return this, it works. Thank you, Frank
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.