alt
Advertisement
Sponsored links
Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow VB.NET 2005 arrow .NET Data Form Wizard
Site Search


.NET Data Form Wizard
Article Index
.NET Data Form Wizard
Page 2

In this tutorial you will learn about Using the Data Form Wizard - Building a Single-Table Data Form, Transform and Filter Data, Using Server Explorer, Drag-and-Drop From Server Explorer, What the user Can and Cannot Drag from Server Explorer, Filtering Data, Filtering With DataViews, Filtering At the Server, Transforming Data with Lookups and Master Detail.

Using the Data Form Wizard

Building a Single-Table Data Form

Adding a single table to a form using a wizard makes for ease of application development. The following example demonstrates the building of a form to display single table using a DataGrid.

Building a Multiple-Table Data Form

In most applications the user needs to create forms that display data in format that shows the master detail relationship. For an example if we have a ComboBox Control bound to a column in a Lookup table and the user needs to show data in a DataGrid which is filtered by the selected column in the ComboBox Control, then this kind of form is said to be a Master Detail form. Now we shall go through another example that illustrates this.

Transform and Filter Data

Using Server Explorer

Server Explorer or Database Explorer is displayed in a window usually docked to the top left hand side of the window. If it is not visible it can be invoked by pressing the keys Ctrl + Alt + S simultaneously. This window shows all the data connections existing in the project. It also displays an icon for creating a new connection. The process of using the Wizard for creating a new connection has already been discussed earlier in this lesson.

Adding a Data Connection

By default, Server Explorer/Database Explorer displays data connections and links to servers that the user has previously used.

Server Explorer displays database connections beneath the Data Connections node. After a connection is established, the user can design programs to open connections and retrieve and manipulate the data provided.

To add a data connection in Server Explorer

1. On the Tools menu, select Connect to Database.

The Data Link Properties dialog box opens. On the Provider tab of the Data Link Properties dialog box, choose an OLE DB provider.

2. On the Connection tab of the Data Link Properties dialog box, provide the information requested. The input fields displayed vary, depending upon the provider selected on the Provider tab.

For example, if the user must select the OLE DB Provider for Oracle, the Connection tab displays fields for server name and login. If the user select the OLE DB Provider for SQL Server, the Connection tab displays fields for server name, type of authentication, and database.

3. Click OK to establish the data connection.

The Data Link Properties dialog box closes, and the new data connection appears beneath the Data Connections node, named for the server and database accessed.

For example, if the user must create a data connection to a database called Nwind on a server named Server1, a new connection named Server1.Nwind.dbo appears beneath the Data Connections node.

Drag-and-Drop From Server Explorer

Server Explorer/Database Explorer is the server management console for Visual Studio .NET. The user can deploy the Server Explorer/Database Explorer to open data connections and to log on to servers and explore their databases and system services. The user can drag nodes from Server Explorer/Database Explorer and drop them onto the Dataset Designer. This creates new data components that are preconfigured to reference the item dropped. When the users drag certain resources from Server Explorer and drop them onto Visual Studio designers, the integrated development environment (IDE) automatically creates new components that reference the resources selected. For example, if the user drags a message queue from Server Explorer onto a Windows project, the IDE automatically creates a System.Messaging.MessageQueue component preconfigured to reference that particular queue. The user can then write code that accesses and manipulates data from that queue via this new component.

To create a new component using Server Explorer

1. Open the project, form, or class to which the user want to add a component in a designer.

2. In Server Explorer, select the item the user want to use.

3. Drag the item from Server Explorer to the designer surface, or right-click the item and click Add to Designer.

.

.

What the user Can and Cannot Drag from Server Explorer

The following table lists items that the user can drag from Server Explorer, and describes the components created when the user drop them onto a Visual Studio project, form, or class designer.

Node type

Draggable items

Result

Servers

Event log categories, message queues, performance counters, and services

 

Event Logs

Event log categories

An System.Diagnostics.EventLog component appears, pointing to the category selected. For more information, see Logging Application, Server, and Security Events.

Message Queues

Individual message queues

A System.Messaging.MessageQueue component appears, pointing to the queue selected. For more information, see Using Messaging Components.

Performance Counters

Individual counters and instances

A System.Diagnostics.PerformanceCounter component appears, pointing to the counter (and instance) selected. For more information, see Introduction to Monitoring Performance Thresholds.

Services

Individual services

A System.ServiceProcess.ServiceController component appears, preconfigured to interact with the service selected. For more information, see Introduction to Communicating with Existing Services.

The user cannot drag any data items from Server Explorer. The user also can create blank components by dragging items from the Toolbox.



 
< Prev   Next >
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape