Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / January 2006

Tip: Looking for answers? Try searching our database.

Can we filter columns in a dataset ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chak - 13 Jan 2006 10:07 GMT
Just as we use RowFilter, to choose a subset of rows , i wish to get s
subset of the columns. The workaround i could think of was to read the
DataTable again with only required columns eg - SELECT COL1 FROM DT1 where
DT1 is the memory datatable.

1) Is it possible to apply a SELECT on a DataTable ?

2) How would one pick only the required columns after populating the dataset
?

Regards.
serge calderara - 13 Jan 2006 10:39 GMT
Use the DataView object

> Just as we use RowFilter, to choose a subset of rows , i wish to get s
> subset of the columns. The workaround i could think of was to read the
[quoted text clipped - 7 lines]
>
> Regards.
Cor Ligthert [MVP] - 13 Jan 2006 10:46 GMT
Chak,

For Net 1.x you can use the styles from a datagrid

For Net 2.0 you can beside that use the overloaded version from the
DataView.ToTable to create a seperated datatable.

I hope this helps,

Cor
Miha Markic [MVP C#] - 13 Jan 2006 15:52 GMT
Hi Chak,

Depends on the data consumer as this is a job for UI.
Which one are you using?

Signature

Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

> Just as we use RowFilter, to choose a subset of rows , i wish to get s
> subset of the columns. The workaround i could think of was to read the
[quoted text clipped - 7 lines]
>
> Regards.
Chak - 13 Jan 2006 18:11 GMT
Thanks.  Am using the Windows forms datagrid in 1.1

Regards,

Chak.

> Hi Chak,
>
[quoted text clipped - 12 lines]
>>
>> Regards.
Miha Markic [MVP C#] - 14 Jan 2006 08:25 GMT
I never use DataGrid (always a third party grid) as DataGrid is very limited
control.
Anyway, you might read this thread:
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_f
rm/thread/8256a795d6abc5b4/e8555f595f3bfd2e?lnk=st&q=hide+datagrid+columns+group
%3A*dotnet*&rnum=1&hl=sl#e8555f595f3bfd2e


Signature

Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

> Thanks.  Am using the Windows forms datagrid in 1.1
>
[quoted text clipped - 18 lines]
>>>
>>> Regards.
serge calderara - 16 Jan 2006 12:36 GMT
With the datagrid you can filter the column to show by defined Column mapping
Then you mapp only columns you need to show

> Thanks.  Am using the Windows forms datagrid in 1.1
>
[quoted text clipped - 18 lines]
> >>
> >> Regards.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.