IDataEnvironment.BuildQuery(IWin32Window, DesignerDataConnection, QueryBuilderMode, String) 方法

定义

启动一个对话框以生成 SQL 查询字符串。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

参数

owner
IWin32Window

该对话框的父窗口。The parent window for the dialog.

connection
DesignerDataConnection

要用于查询的数据连接。The data connection to use for the query.

mode
QueryBuilderMode

QueryBuilderMode 值之一。One of the QueryBuilderMode values.

initialQueryText
String

查询的初始值,或为 Empty 以创建新查询。The initial value of the query or Empty to create a new query.

返回

String

一个包含 SQL 查询的字符串,如果用户取消,则为 nullA string containing the SQL query, or null if the user canceled.

注解

BuildQuery方法启动设计环境的 UI,以便编辑或创建 SQL 查询字符串。The BuildQuery method launches the design environment's UI for editing or creating SQL query strings. 如果 initialQueryText 参数为 Empty ,则指示用户要创建新的查询。If the initialQueryText parameter is Empty, it indicates the user wants to create a new query. 如果 initialQueryText 参数包含一个字符串,则指示用户要编辑现有查询。If the initialQueryText parameter contains a string, it indicates the user wants to edit the existing query.

mode参数指示用户要生成的查询类型,可以选择、更新、插入或删除。The mode parameter indicates the type of query the user wants to build; either select, update, insert, or delete. 你的用户界面可以使用 mode 参数为所需的查询类型配置自身,将使用 SQL 语句的 SQL 语句限制为仅对所需的查询类型有效,并/或根据所需类型验证查询。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.

适用于