Relation tables order --> order_detail

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

First of all, sorry for my english if is not very well, I am spanish.

My problem is these:
I have an DataSet1.xsd, contain two tables, one is "order" and the other is
"order_detail" and between this tables exist one relation, one to many,
if I want to import the information of one table too the DataGrid without
relation I do this SQlDataAdapter.Fill(DataSet,"nametable"), but when I have
one relation between two tables, How I can to do this when I have one
relation between two tables and see this information?

brgs
Jaime
 
Hi Jaime,

You would need two selects - perhaps the easiest way is to use two adapters:
one per each table.
 
Thanks Miha

I am new in this language, an I work with CSHARP, then the best way is using
two strings with two select and two SqlDataAdapter.

Image that you have a textbox where your write a value for filter the table
order and show the result in a datagrid, and in other datagrid the
order_detail for this value.

Can you write the code, please.

Brgds
Jaime

Miha Markic said:
Hi Jaime,

You would need two selects - perhaps the easiest way is to use two adapters:
one per each table.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com


Jaime Jimenez said:
Hi

First of all, sorry for my english if is not very well, I am spanish.

My problem is these:
I have an DataSet1.xsd, contain two tables, one is "order" and the other
is
"order_detail" and between this tables exist one relation, one to many,
if I want to import the information of one table too the DataGrid without
relation I do this SQlDataAdapter.Fill(DataSet,"nametable"), but when I
have
one relation between two tables, How I can to do this when I have one
relation between two tables and see this information?

brgs
Jaime
 
Hello,

Do you have to have two tables? Its not real clear but if you are just
trying to display the information from both tables in a datagrid, just do the
join on the data base.

Or you could use a dataview populating with the
Dataset.Tables("YourTable").Select(Filter) method.

If you want i can take a look at the code and put something together for
you. (e-mail address removed)
 
Back
Top