Επεξεργασία

Κοινή χρήση μέσω


IDataEnvironment.BuildQuery Method

Definition

Launches a dialog to build a SQL query string.

public:
 System::String ^ BuildQuery(System::Windows::Forms::IWin32Window ^ owner, System::ComponentModel::Design::Data::DesignerDataConnection ^ connection, System::ComponentModel::Design::Data::QueryBuilderMode mode, System::String ^ initialQueryText);
public string BuildQuery (System.Windows.Forms.IWin32Window owner, System.ComponentModel.Design.Data.DesignerDataConnection connection, System.ComponentModel.Design.Data.QueryBuilderMode mode, string initialQueryText);
abstract member BuildQuery : System.Windows.Forms.IWin32Window * System.ComponentModel.Design.Data.DesignerDataConnection * System.ComponentModel.Design.Data.QueryBuilderMode * string -> string
Public Function BuildQuery (owner As IWin32Window, connection As DesignerDataConnection, mode As QueryBuilderMode, initialQueryText As String) As String

Parameters

owner
IWin32Window

The parent window for the dialog.

connection
DesignerDataConnection

The data connection to use for the query.

mode
QueryBuilderMode

One of the QueryBuilderMode values.

initialQueryText
String

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

Returns

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

Remarks

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.

Applies to