Hi Gary,
You can limit the grid to only contain certain fields in a DataTable. Set the DataGrid's DataSource to a DataTable, not the DataSet (if there is more than one DataTable contained in the DataSet). To limit the columns, select the DataGrid in design mode, go to the Properties Window, and select the Columns property. Click on the elipse (...) button next to the Columns property to launch the DataGrid Properties dialog. First, uncheck the "Create columns automatically at run time" checkbox and then add your columns as "bound columns".
The DataSet is disconnected from the data source and therefore there is no need to have the SQL connection. Retrieving data from a Web Service is a common practice.
>Thanks for the reply Cathi.
>
>What I am actually trying to accomplish is to bind certain fields from a dataset to a datagrid within a Web app that has no SQL connection or data adapters defined. The app makes a call to a Web service method, which then connects to SQL server (or Oracle or FoxPro or ...) and collects the data into a dataset, which it returns to the app. This all works fine if I bind the entire dataset to the datagrid, but I would like to select only certain fields to bind to grid columns.
>
>Thanks again,
>Gary
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi