Docsity

ADO.NET Tools - C Sharp Programming - Lecture Slides, Slides of C Sharp Programming

Partial preview of the text

Download ADO.NET Tools - C Sharp Programming - Lecture Slides and more Slides C Sharp Programming in PDF only on Docsity!

ADO.NET Tools and

Wizards

Data Sources Window

(Introduction)

 Use the Data Sources window to

 Establish a connection

 Create bound control instances on a form

Configuring a Data Source

(Steps 2)

Connect to a database

Configuring a Data Source

(Steps 3)

Create a new connection or select an existing one

Configuring a Data Source

(Steps 5)

Select the database filename

Configuring a Data Source

(Steps 6)

Configured connection

Configuring a Data Source

(Steps 8)

Save the connection string

Configuring a Data Source

(Steps 9)

Select the objects to include

Creating Bound Control

Instances (Introduction)

 Bound control instances are created by

dragging a field (or table) from the Data

Sources window to the form

Creating Bound Control

Instances (Illustration)

The BindingSource

(Introduction)

 The BindingSource was new to .NET 2.  One purpose is to provide currency (current record) management  DataSets and DataTables do not provide currency management  It’s methods are used to locate a record in a particular DataTable  The BindingSource can also be used to add, change, and delete list items  Changes are propagated to the underlying data source ( DataSet and DataTable )

The BindingSource

(Properties)

 Two properties are significant

 The DataSource property contains the

name of the DataSet

 The DataMember property contains the

name of a database table from the DataSet

The BindingSource Class

(Members)

 MoveFirst , MovePrevious , MoveNext ,

MoveLast methods perform navigation

 Current gets the current item from the

database table

The BindingNavigator

(Introduction)

 The BindingNavigator provides a user

interface for the BindingSource

 Control instances are typically bound to the

navigator items