1 / 14

Integrating Data

Learn how to integrate different data sources into Windows applications using the ADO.NET framework. Understand data stores, ADO.NET architecture, data providers, and how to work with data controls in both Windows Forms and WPF applications.

morgans
Download Presentation

Integrating Data

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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.

  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. ADO.NET Architecture DataProvider DataSet Connection DataTableCollection Command DataRelationCollection Data Store DataReader XML DataAdapter

  6. ADO.NET Architecture • 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

  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. 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.

More Related