473,322 Members | 1,398 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,322 software developers and data experts.

Problem with DataRelation

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

Mar 12 '06 #1
3 954
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?...b-8b8620d93761

This one is brand new, I find it very nice.
http://www.vb-tips.com/default.aspx?...e-a16566bd6c9f

I hope this helps,

Cor

"Mrozu" <gr************@gmail.com> schreef in bericht
news:11**********************@z34g2000cwc.googlegr oups.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

Mar 12 '06 #2
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

Mar 12 '06 #3
Thx Cor I've done it:) I've used second sample, rebuild it and it's
working great;):D
Mrozu

Mar 12 '06 #4

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

Similar topics

3
by: serge calderara | last post by:
Dear all, I have a dataset which contains 2 DataTable The idea is to bind a text box control with one table field and then diaplaye the associated content of the second table based on the first...
1
by: yaser | last post by:
Hello: I need save my update but i can't :confused: :confused: :confused: look my code : Imports System.Data Imports System.Data.OleDb Public Class Form1
0
by: Fox | last post by:
Is it possible to get back the DataRelation contect from a dataSet? { DataRelation myDataRelation; DataColumn parentColumn; DataColumn childColumn; parentColumn = myDataSet.Tables.Columns;...
1
by: Johann Blake | last post by:
I have a dataset that contains a parent table and a child table. A DataRelation exists between the two. I was under the impression from reading the VS docs that when I filled the parent table, the...
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...
8
by: Dave Hagerich | last post by:
I'm using a DataGrid with a DataSet and I'm trying to filter the data being displayed, using the following code as a test: DataView theView = new DataView(theDataSet.Tables); theView.RowFilter =...
14
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these...
2
by: Rich | last post by:
Hello, Following an example at http://www.vb-tips.com/dbpages.aspx?IA=DG (by Cor Lightert and Ken Tucker) on binding a dataRelation to a Datagridview for sqlClient, I was able to view rows...
1
by: Sep410 | last post by:
Private Sub frmSearch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim sql1 As String Dim sql2 As String Dim da1 As SqlDataAdapter ...
2
by: Tony Johansson | last post by:
Hello! I can't understand what is this table DataRelation used for. I mean as long as you have this DataTable I can't see any point in using this DataRelation. //Tony
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.