IDataEnvironment.BuildQuery Method (IWin32Window, DesignerDataConnection, QueryBuilderMode, String)

 

Launches a dialog to build a SQL query string.

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

string BuildQuery(
	IWin32Window owner,
	DesignerDataConnection connection,
	QueryBuilderMode mode,
	string initialQueryText
)

Parameters

owner
Type: System.Windows.Forms.IWin32Window

The parent window for the dialog.

connection
Type: System.ComponentModel.Design.Data.DesignerDataConnection

The data connection to use for the query.

mode
Type: System.ComponentModel.Design.Data.QueryBuilderMode

One of the QueryBuilderMode values.

initialQueryText
Type: System.String

The initial value of the query or Empty to create a new query.

Return Value

Type: System.String

A string containing the SQL query, or null if the user canceled.

The BuildQuery method launches the design environment's UI for editing or creating SQL query strings. If the initialQueryText parameter is Empty, it indicates the user wants to create a new query. If the initialQueryText parameter contains a string, it indicates the user wants to edit the existing query.

The mode parameter indicates the type of query the user wants to build; either select, update, insert, or delete. Your user interface can use the mode parameter to configure itself for the type of query desired, limit the user to using SQL statements valid only for the type of query desired, and/or validate the query against the desired type.

.NET Framework
Available since 2.0
Return to top
Show: