Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IDataEnvironment.BuildConnection Method

Creates a new data connection or edits an existing connection using the design tool's new connection user interface.

Namespace: System.ComponentModel.Design.Data
Assembly: System.Design (in system.design.dll)

DesignerDataConnection BuildConnection (
	IWin32Window owner,
	DesignerDataConnection initialConnection
)
DesignerDataConnection BuildConnection (
	IWin32Window owner, 
	DesignerDataConnection initialConnection
)
function BuildConnection (
	owner : IWin32Window, 
	initialConnection : DesignerDataConnection
) : DesignerDataConnection
Not applicable.

Parameters

owner

The parent window for the connection dialog.

initialConnection

The connection, if any, to edit. To create a new connection, initialConnection should be a null reference (Nothing in Visual Basic).

Return Value

A new or edited DesignerDataConnection object, or a null reference (Nothing in Visual Basic) if the user canceled.

Use the BuildConnection method to activate the design environment's user interface for creating or editing data connections. If the initialConnection parameter is a null reference (Nothing in Visual Basic), it indicates the user wants to create a new connection. If the initialConnection parameter is a DesignerDataConnection object, it indicates the user wants to edit an existing connection.

Your design environment is responsible for creating the data connection, adding the connection either to a global list of connections or to the Web application's configuration file, and adding the new connection to the Connections property.

The new connection should include the information that the application needs to create a data connection at run time. If you need to use the data connection in the design environment, use the GetDesignTimeConnection method to return a DbConnection object that will connect to the data store from the design environment.

If the user chooses to cancel the new connection creation process, the BuildConnection method should return a null reference (Nothing in Visual Basic).

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.