Re: a basic question by William
William
Tue Jan 04 16:50:06 CST 2005
I would not use the DataReader for this--just execute Fill and bind to one
or more controls as needed.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"neptune3k" <neptune3k@discussions.microsoft.com> wrote in message
news:E95081A3-4A15-4DD7-95A8-003DCABCDB5A@microsoft.com...
> Hi, Bill, what do you mean by client-side logic? I could read them into a
> SqlDataReader, but then what's the good .net way of displaying them, say
> if
> (db column)location='us' then display (column)zip as "Postal", otherwise
> display (column)province as "Postal. I could do it the hard way, looping
> through the reader and construct my own table,then bind the table to some
> data control, but there should be an easier way... or not?
>
> "William (Bill) Vaughn" wrote:
>
>> There are several approaches to this problem (as usual).
>> One way would be to fetch all of the columns and use client-side logic to
>> view or hide appropriate columns.
>> Another way would be to write a stored procedure that chooses an
>> appropriate
>> SELECT statement based on logic.
>>
>> --
>> ____________________________________
>> William (Bill) Vaughn
>> Author, Mentor, Consultant
>> Microsoft MVP
>> www.betav.com
>> Please reply only to the newsgroup so that others can benefit.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> __________________________________
>>
>> "neptune3k" <neptune3k@discussions.microsoft.com> wrote in message
>> news:9D190986-4DCB-4C66-A124-254416CE78AC@microsoft.com...
>> > Hi, I'm new to ADO.NET. I'm have a very basic problem and trying to
>> > figure
>> > out what is the best way to approach in .net. I just need to display
>> > some
>> > fields of a table (read only), but I need to choose which fields to
>> > display
>> > depending on the value of a field. Which one of the web controls and
>> > ADO
>> > class is best fit to this purpose? (so, for example if columnA='a',
>> > display
>> > coloum B C D, otherwise display column D E F...)
>> >
>> > TIA.
>>
>>
>>