Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding dataset from Web service to datagrid
Message
 
To
08/01/2003 18:04:45
Gary Otte
California Youth Authority
Sacramento, California, United States
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00739059
Message ID:
00739616
Views:
14
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.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform