Home All Groups Group Topic Archive Search About

Problem with DataRelation

Author
12 Mar 2006 6:12 PM
Mrozu
Hi

I have problem with binding two DataTables. Certainly I don't know how
do that so maybe i write what i wanna do.

I have two datatables in my dataset.

First :
"mag1" with columns:
tw_kod
st_stan_mag1

and second "mag2" with columns

tw_kod
st_stan_mag2

and I want to get one table, with three cols:

tw_kod
st_stan_mag1
st_stan_mag2

and i don't know how

in normal SQL i wrote:
SELECT     twary_b_mag1.tw_kod, twary_b_mag1.st_stan_mag1,
twary_b_mag2.st_stan_mag2
FROM         twary_b_mag1 INNER JOIN
                      twary_b_mag2 ON twary_b_mag1.tw_kod =
twary_b_mag2.tw_kod

and it works great

how i can do that in my app in DataSet??

Mrozu

Author
12 Mar 2006 7:52 PM
Cor Ligthert [MVP]
Mrozu,

Your join creates as far as I saw one table.

You just can get two separete tables and than use one of the samples on our
website.

http://www.vb-tips.com/default.aspx?ID=d667d78f-4b08-42ef-ba3b-8b8620d93761

This one is brand new, I find it very nice.
http://www.vb-tips.com/default.aspx?ID=5cedaf79-ff31-464e-945e-a16566bd6c9f

I hope this helps,

Cor

Show quoteHide quote
"Mrozu" <grzesiek.mr***@gmail.com> schreef in bericht
news:1142187142.281886.188650@z34g2000cwc.googlegroups.com...
> Hi
>
> I have problem with binding two DataTables. Certainly I don't know how
> do that so maybe i write what i wanna do.
>
> I have two datatables in my dataset.
>
> First :
> "mag1" with columns:
> tw_kod
> st_stan_mag1
>
> and second "mag2" with columns
>
> tw_kod
> st_stan_mag2
>
> and I want to get one table, with three cols:
>
> tw_kod
> st_stan_mag1
> st_stan_mag2
>
> and i don't know how
>
> in normal SQL i wrote:
> SELECT     twary_b_mag1.tw_kod, twary_b_mag1.st_stan_mag1,
> twary_b_mag2.st_stan_mag2
> FROM         twary_b_mag1 INNER JOIN
>                      twary_b_mag2 ON twary_b_mag1.tw_kod =
> twary_b_mag2.tw_kod
>
> and it works great
>
> how i can do that in my app in DataSet??
>
> Mrozu
>
Author
12 Mar 2006 8:27 PM
Mrozu
yeah

very good samples but i think that i'm too novice in VB.NET and i can't
use it in my problem... can you help me? how i can rebuild this samples
to get what i want?

maybe i'll explain my problem again.

I have two tables. First(mag1) with cols tw_kod | st_stan_mag1
and second table(mag2) with cols tw_kod | st_stan_mag2

In first table is one row with

tw_kod | st_stan_mag1
kod1    | 12

and in second:

tw_kod | st_stan_mag2
kod1    | 14

and i want to see for example in my DataGrid:

tw_kod | st_stan_mag1 | st_stan_mag2
kod1    | 12                  | 14

I thing that now it is very clearly explained

sorry for my english, i'm from Poland and you know, still learning:)


Mrozu
Author
12 Mar 2006 9:26 PM
Mrozu
Thx Cor I've done it:) I've used second sample, rebuild it and it's
working great;):D


Mrozu