Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
DataGrid with only certain columns from a dataset
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();
dataTable = ds.Tables["prog"];
totalRec = dataTable.Rows.Count;
//Can I Bind Only certain columns of the dataset?