Presentation is loading. Please wait.

Presentation is loading. Please wait.

Integrating Data Lesson 6.

Similar presentations


Presentation on theme: "Integrating Data Lesson 6."— Presentation transcript:

1 Integrating Data Lesson 6

2 Objectives

3 Data in Windows Application
When creating Windows Applications with Visual Studio, you have the capability to integrate various data sources within the application. A data source enables you to save application data into a managed medium where you are not concerned about the format of the file system data, only with the format presented by the management medium. The Microsoft .NET Framework provides consistent access to various data sources through the Active Data Objects (ADO.NET) set of classes in the System.Data namespace. Table 4-1 shows common Windows Form Events

4 Data in Windows Application
A data store is a data file and a management engine that provides access into the data file. Examples: Microsoft Access and Microsoft SQL Server Data store interactions are handled through the use of the .NET Framework System.Data (ADO.NET) and System.XML namespaces.

5 DataRelationCollection
ADO.NET Architecture DataProvider DataSet Connection DataTableCollection Command DataRelationCollection Data Store DataReader XML DataAdapter

6 There are two major components to the ADO.NET architecture:
DataProvider: A fast forward-only, read-only data manipulation interface to a data store. DataSet: A collection of tables, with rows and columns, primary keys, foreign keys, and constraints, and the relationships between the tables.

7 ADO.NET Architecture Microsoft has developed these two namespaces to provide you with the ability to have both connected and disconnected data objects. Connected is when you can read/write directly with a data source. Disconnected is when you can read/write temporarily to an XML file until connected again.

8 .NET Framework Data Providers
The .NET Framework provides several built-in Data Providers. Data Providers can be developed by anyone who needs to interface with a data store, but are typically produced by the data store’s manufacturer: .NET Framework Data Providers include: SQL Server Object Linking and Embedding (OLE) Database (DB) ODBC Oracle

9 Server Explorer The Server Explorer window is a centralized location within the Visual Studio environment where you can manage and create connects to data sources and servers. The Server Explorer provides a create data source connection feature that provides a set of dialogs to configure and test data source connections.

10 Change Data Source Dialog
A Data Connection inside of the Server Explorer has several features that you will use to interact with your database. For each Data Connection, Server Explorer adds subfolders entitled Tables, Views, Stored Procedures, and Functions.

11 Windows Forms Data Controls
The .NET Framework provides several Windows Forms controls that can be used to present data store information. Windows Forms Data Controls include: BindingSource DataSet BindingNavigation DataGridView

12 WPF Binding Working with data in the WPF application is more flexible, easier, and more powerful than any previous Microsoft application development environment. WPF introduces the capability to bind anything from controls, to XML, to properties, or objects themselves. WPF binding is the process of associating a WPF element’s property to a data source. To implement binding in WPF, you must have a target and a source.

13 Binding Modes OneWay - Continuously updates the target when the source changes. OneTime - Updates the target at the start of the application or when the DataContent property changes. OneWayToSource - Updates the source with the target’s data. TwoWay Updates - Updates in both directions.

14 WPF Specialized Binding
WPF has two special elements that enable your WPF application to bind to data. Use the XMLDataProvider and the ObjectDataProvider to bind your XAML elements to data. The two data binding classes and some of their properties and methods are: XMLDataProvider ObjectDataProvider

15 Summary You learned how to create functionality using the ADO.NET System.Data namespaces. You learned how create a connection to a data store and then use that connection to create Windows Forms and WPF applications. You learned how to create Windows Forms data controls and validate data manipulation actions.


Download ppt "Integrating Data Lesson 6."

Similar presentations


Ads by Google