Re: Performing Lookups on Dataset
From: Hemang Shah (hemang_at_hemang.net)
Date: 03/16/05
- Next message: Scott M.: "Re: No 'findby' method in strongly typed dataset"
- Previous message: Pablo Castro [MS]: "Re: Concurrent Connections / Shared Transaction"
- In reply to: Saravanan K V: "Re: Performing Lookups on Dataset"
- Next in thread: Saravanan K V: "Re: Performing Lookups on Dataset"
- Reply: Saravanan K V: "Re: Performing Lookups on Dataset"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Mar 2005 17:46:16 -0500
Does the Lookup table have to be indexed on typeid ?
or sorted ? or any restriction ?
"Saravanan K V" <SaravananKV@discussions.microsoft.com> wrote in message
news:972BC728-24C9-40EC-9444-9E887FE2C106@microsoft.com...
> Hi,
>
> You can use Find method of Rows Collection in the DataTable like this:
>
> DataRow dr = Lookup.Rows.Find(typeid);
> String TypeName = dr["TypeName"];
>
>
> Regards,
> Saravanan K V
>
> "news.microsoft.com" wrote:
>
>> Thanks Val
>>
>> That would be easy.
>>
>> However the first table has multiple fields of ID thas has the
>> corresponding
>> name in the lookup table.
>>
>> I can't have multiple Joins on all these fields between the same two
>> table
>> right ?
>>
>> That was the reason for my lookup function.
>>
>> Any ideas ?
>>
>> "Val Mazur (MVP)" <group51a@hotmail.com> wrote in message
>> news:O%23NETlcKFHA.508@TK2MSFTNGP12.phx.gbl...
>> > Hi,
>> >
>> > If these two tables are in a database then when you select data you
>> > could
>> > join these two tables using next kind of SQL statement and it will
>> > bring
>> > all the related descriptions for the types
>> >
>> > SELECT Customer.*, Lookup.TypeName FROM Customer LEFT JOIN Lookup ON
>> > Customer.CustTypeID1=Lookup.TypeID
>> >
>> > --
>> > Val Mazur
>> > Microsoft MVP
>> >
>> > http://xport.mvps.org
>> >
>> >
>> >
>> > "Hemang Shah" <hemang@hemang.net> wrote in message
>> > news:B_ydnTTY_9297KrfRVn-qw@rogers.com...
>> >> In the customer table, the primary key of the lookup table is stored.
>> >>
>> >> e.g:
>> >>
>> >> Table Customer
>> >>
>> >> CustTypeID1
>> >> CustTypeID2
>> >> ...
>> >>
>> >>
>> >> Table Lookup
>> >>
>> >> TypeID
>> >> TypeName
>> >>
>> >>
>> >>
>> >> Now in report or on the form, is there a quickway to do a lookup on
>> >> table
>> >> Lookup by the id ?
>> >>
>> >> I want a function like this:
>> >>
>> >> TypeName = Lookup(typeid);
>> >>
>> >> So that I can use this in crystal reports and also on the forms..
>> >>
>> >> Any suggestions would be welcome.
>> >>
>> >> Thanks
>> >>
>> >>
>> >
>> >
>>
>>
>>
- Next message: Scott M.: "Re: No 'findby' method in strongly typed dataset"
- Previous message: Pablo Castro [MS]: "Re: Concurrent Connections / Shared Transaction"
- In reply to: Saravanan K V: "Re: Performing Lookups on Dataset"
- Next in thread: Saravanan K V: "Re: Performing Lookups on Dataset"
- Reply: Saravanan K V: "Re: Performing Lookups on Dataset"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|