C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
DataGrid with only certain columns from a dataset Posted by GhostOfHendrix on 26 Nov 2004 at 3:02 PM
Hey everyone.
I would like to know how to display data from a dataset in a datagrid with only certain columns included from the dataset. I know how to display all of the dataset into a datagrid, but I would like to leave out some fields such as recordID and such that I dont want to display to the user. Can someone help?

This is how I fill the datagrid:

dataAdapter = new OleDbDataAdapter(CommandString, conn);
ds = new DataSet();
dataAdapter.Fill(ds, "prog");
dataTable = ds.Tables["prog"];
totalRec = dataTable.Rows.Count;

//Can I Bind Only certain columns of the dataset?
dgEvents.SetDataBinding(ds, "prog");
Thread Tree
GhostOfHendrix DataGrid with only certain columns from a dataset on 26 Nov 2004 at 3:02 PM
Xtreme.NET Re: DataGrid with only certain columns from a dataset on 26 Nov 2004 at 8:26 PM
GhostOfHendrix Re: DataGrid with only certain columns from a dataset on 26 Nov 2004 at 8:40 PM
Xtreme.NET Re: DataGrid with only certain columns from a dataset on 29 Nov 2004 at 6:51 PM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.