PC Review


Reply
Thread Tools Rate Thread

Datatable for a multi valued column?

 
 
STom
Guest
Posts: n/a
 
      4th Aug 2003
I have a requirement to create a DataTable that relates to information on a
particular web screen. This wouldn't be too difficult except that one of the
fields is a multi-select listbox.

What is the best way to do this with a Datatable?

Thanks.

STom


 
Reply With Quote
 
 
 
 
Carl Prothman [MVP]
Guest
Posts: n/a
 
      4th Aug 2003
"STom" <(E-Mail Removed)> wrote
> I have a requirement to create a DataTable that relates to information on a
> particular web screen. This wouldn't be too difficult except that one of the
> fields is a multi-select listbox.
>
> What is the best way to do this with a Datatable?


Tom,
Sounds like a many-to-many relationship. How about using a intersection table?
e.g.
Entity1 table
Intersection table - contains the primary keys from both entity tables
Entity2 table

Then just fill in the multi-select listbox value(s) from Entity2 table using the
Intersection table.

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com




 
Reply With Quote
 
STom
Guest
Posts: n/a
 
      4th Aug 2003
Carl,

Yes, it is a many-to-many relationship.

What I am trying to find out though is how, programmatically, while I'm
building my table of values in ado.net, do I include this relationship and
its records.

STom
"Carl Prothman [MVP]" <(E-Mail Removed)> wrote in message
news:OT0%(E-Mail Removed)...
> "STom" <(E-Mail Removed)> wrote
> > I have a requirement to create a DataTable that relates to information

on a
> > particular web screen. This wouldn't be too difficult except that one of

the
> > fields is a multi-select listbox.
> >
> > What is the best way to do this with a Datatable?

>
> Tom,
> Sounds like a many-to-many relationship. How about using a intersection

table?
> e.g.
> Entity1 table
> Intersection table - contains the primary keys from both entity

tables
> Entity2 table
>
> Then just fill in the multi-select listbox value(s) from Entity2 table

using the
> Intersection table.
>
> --
>
> Thanks,
> Carl Prothman
> Microsoft ASP.NET MVP
> http://www.able-consulting.com
>
>
>
>



 
Reply With Quote
 
Carl Prothman [MVP]
Guest
Posts: n/a
 
      5th Aug 2003
"STom" <(E-Mail Removed)> wrote
> Yes, it is a many-to-many relationship.
> What I am trying to find out though is how, programmatically, while I'm
> building my table of values in ado.net, do I include this relationship and
> its records.
>


You can either find the corresponding record(s) manually by using the
DataTable.Rows Find method.
http://msdn.microsoft.com/library/en...sfindtopic.asp

Or you can create a DataRelation between the DataTables at runtime,
http://msdn.microsoft.com/library/de...classtopic.asp
then transverse the relationships using the DataRow GetChildRows methods
to get the corresponding record(s).
http://msdn.microsoft.com/library/en...drowstopic.asp

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com




 
Reply With Quote
 
STom
Guest
Posts: n/a
 
      5th Aug 2003
Thanks Carl!

STom
"Carl Prothman [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "STom" <(E-Mail Removed)> wrote
> > Yes, it is a many-to-many relationship.
> > What I am trying to find out though is how, programmatically, while I'm
> > building my table of values in ado.net, do I include this relationship

and
> > its records.
> >

>
> You can either find the corresponding record(s) manually by using the
> DataTable.Rows Find method.
>

http://msdn.microsoft.com/library/en...sfindtopic.asp
>
> Or you can create a DataRelation between the DataTables at runtime,
>

http://msdn.microsoft.com/library/de...classtopic.asp
> then transverse the relationships using the DataRow GetChildRows methods
> to get the corresponding record(s).
>

http://msdn.microsoft.com/library/en...drowstopic.asp
>
> --
>
> Thanks,
> Carl Prothman
> Microsoft ASP.NET MVP
> http://www.able-consulting.com
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-valued field Jimmy G. Microsoft Access Queries 11 6th Mar 2009 12:16 AM
Multi-valued field query Merge user Microsoft Access Queries 2 9th Feb 2009 08:40 PM
If multi-valued fields is discorage, what should I use instead? JLPerez Microsoft Access VBA Modules 4 2nd Oct 2008 06:07 PM
How assign multi-valued value to a variable =?Utf-8?B?V29vZHk=?= Microsoft Access Form Coding 13 19th Oct 2007 01:56 AM
Display a multi-valued field across instead of down =?Utf-8?B?bWFnaWNr?= Microsoft Access Reports 2 4th Sep 2007 08:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:19 PM.