Typed DATASET help

  • Thread starter Thread starter Mat
  • Start date Start date
M

Mat

I have typed dataset and i don't know how to filter rows of table A
according to children rows in table B

Example
TABLE USER has columns ID,Name

Table USERNICK has columns nickname, ID


Relationship is : each user can have many nicksname. (1,N)


using dataview, i want to show ALL user in table USERS which has nickname "
MAT"


Anyone can help??
 
You need to create a relation ( Between USER and USERNICK ) in the dataset
and use this as the dataSource

Regards - OHM
I have typed dataset and i don't know how to filter rows of table A
according to children rows in table B

Example
TABLE USER has columns ID,Name

Table USERNICK has columns nickname, ID


Relationship is : each user can have many nicksname. (1,N)


using dataview, i want to show ALL user in table USERS which has
nickname " MAT"


Anyone can help??

Best Regards - OHMBest Regards - OHM (e-mail address removed)
 
you misunderstand my question

The relation is already created using xsd.
Usually, to filter rows we do:
dim d as dataview = new dataview(mydataset.USERS)
D.rowfilter="name Like 'myname'"

This is correct if the column name is in the table USERS.

What i want to do is to filter table USERS according to child Table
Usernicks. i mean i want to shows rows of table USERS ,which has children
rows in table Usernicks and name "MAT" using dataview.
 
Hi Mat,

I don't think that there is an easy solution.
You should collect all id from usernick where nick = desired nick.
Than you set filter on user table: id in (collected id).
 
This should work.
First, locate the NickName row with the desired name in
the Nicks DataTable (accessible through the dataset
Tables collection). I know you can step through a
DataTable's rows, checking values (as undesirable as that
may or may not be for you). Then, referencing the child
row (Nicks), use that datarow's method GetParentRow to
get the Parent Row, then use that row's method
GetChildRows to get all Child rows for the parent.

mklapp
-----Original Message-----
you misunderstand my question

The relation is already created using xsd.
Usually, to filter rows we do:
dim d as dataview = new dataview(mydataset.USERS)
D.rowfilter="name Like 'myname'"

This is correct if the column name is in the table USERS.

What i want to do is to filter table USERS according to child Table
Usernicks. i mean i want to shows rows of table USERS ,which has children
rows in table Usernicks and name "MAT" using dataview.





"One Handed Man [ OHM ]" <terry_burnsREMOVE%FOR%NO% (e-mail address removed)>
wrote in message news:% (e-mail address removed)...
You need to create a relation ( Between USER and USERNICK ) in the dataset
and use this as the dataSource

Regards - OHM


Best Regards - OHMBest Regards - OHM (e-mail address removed)


.
 
Why not create a relation in reverse making the child the parent and visa
versa ?

Regards - OHM

you misunderstand my question

The relation is already created using xsd.
Usually, to filter rows we do:
dim d as dataview = new dataview(mydataset.USERS)
D.rowfilter="name Like 'myname'"

This is correct if the column name is in the table USERS.

What i want to do is to filter table USERS according to child Table
Usernicks. i mean i want to shows rows of table USERS ,which has
children rows in table Usernicks and name "MAT" using dataview.





"One Handed Man [ OHM ]"
You need to create a relation ( Between USER and USERNICK ) in the
dataset and use this as the dataSource

Regards - OHM


Best Regards - OHMBest Regards - OHM (e-mail address removed)

Best Regards - OHMBest Regards - OHM (e-mail address removed)
 
Back
Top