Editing Typed Data Sets

There is a designer provided solely for editing (and creating) typed data sets within Visual Studio: the data set designer. This designer launches automatically when you open a DataSet project item such as the AdventureWorksEmployeeDataSet.xsd file that we just created when investigating data binding.


Note

Typed DataSet objects can be huge productivity enhancers over a normal data set: instead of using indexes into collections, you can reference tables and columns by their actual names. In addition, IntelliSense works with typed DataSet members, making coding against large data hierarchies much easier.


You can use the data set designer to easily tweak data sets by changing any of the various constituent parts, including the queries used to populate the data set. Figure 13.36 shows the previously created AdventureWorksEmployeeDataSet open in the data set designer.

Image

FIGURE 13.36 The data set designer.

Note that each piece of the data set is visually represented here, and we can interact with those pieces to effect changes. For instance, if we want to alter the query we originally constructed using the Data Set Configuration Wizard, we right-click the Employee table on the design surface and select Configure to relaunch the query editor.

In the scenario we have been discussing, we are wiring the data set directly to the results from a SQL query, but we can also use the data set designer to create “unbound” new data sets. Adding a DataSet project item to our project enables us to start with a blank slate, adding tables, queries, and so on to the data set to satisfy any storage requirements (or data retrieval requirements) that our application might have. This is especially useful for applications that read and write data but don’t necessarily interact with a database. These data set files can be used as simple file storage that you can easily bind later to a relational database.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset