KeyFields Property (BigQueryCommandBuilder)
On this page
Gets or sets string containing list of key field names separated by semicolon. They are used to generate update commands.
Syntax
|
|---|
'Declaration
Public Shadows Property KeyFields As String |
|
|---|
public new string KeyFields {get; set;} |
Property Value
The string containing list of key field names separated by semicolon.
Example
The following example demonstrates how UPDATE and DELETE statements are generated.
|
|---|
public void UseKeyFields(string connectionString) {
BigQueryConnection conn = new BigQueryConnection(connectionString);
conn.Open();
BigQueryDataAdapter adapter = new BigQueryDataAdapter("SELECT * FROM your_project.your_dataset.employees", conn);
BigQueryCommandBuilder commBuilder = new BigQueryCommandBuilder(adapter);
commBuilder.ConflictOption = ConflictOption.OverwriteChanges;
commBuilder.KeyFields = "id, first_name";
string updateComm = commBuilder.GetUpdateCommand().CommandText;
string deleteComm = commBuilder.GetDeleteCommand().CommandText;
Console.WriteLine(updateComm);
Console.WriteLine(deleteComm);
conn.Close();
} |
|
|---|
Public Sub UseKeyFields(ByVal connectionString As String)
Dim conn As BigQueryConnection = New BigQueryConnection(connectionString)
conn.Open()
Dim adapter As BigQueryDataAdapter = New BigQueryDataAdapter("SELECT * FROM your_project.your_dataset.employees", conn)
Dim commBuilder As BigQueryCommandBuilder = New BigQueryCommandBuilder(adapter)
commBuilder.ConflictOption = ConflictOption.OverwriteChanges
commBuilder.KeyFields = "id, first_name"
Dim updateComm As String = commBuilder.GetUpdateCommand().CommandText
Dim deleteComm As String = commBuilder.GetDeleteCommand().CommandText
Console.WriteLine(updateComm)
Console.WriteLine(deleteComm)
conn.Close()
End Sub |
See Also