DB2®BulkCopy.DestinationTableName Property
Name of the destination table on the server, where rows from the data source will be copied.
- Namespace:
IBM.Data.DB2
- Assembly:
IBM.Data.DB2
(inIBM.Data.DB2.dll
)
Syntax
[Visual Basic]
Public Property DestinationTableName As String
[C#]
public string DestinationTableName {get; set;}
[C++]
public: __property String* get_DestinationTableName();
public: __property void set_DestinationTableName(String*);
[JScript]
public function get DestinationTableName() : String;
public function set DestinationTableName(String);
Property value
The string value of the destination table's name.
Remarks
A DestinationTableName must
be set for the WriteToServer operation to be successful.
If case sensitivity needs to be maintained for the destination table
name, you need to enclose the destination table name in an extra set
of double quotes. For example:
salesCopy.DestinationTable = "\"CanadaSales\"";
The value you provide for DestinationTableName can
optionally include the database name and the schema name, in addition
to the mandatory table name. For example: SAMPLE.USER.SALES
.
Example
[C#] The following example demonstrates a bulk copy of data from a DataTable source into the SALES table.
[C#]
public static void copyIntoSales(DB2Connection conn, DataTable source)
{
DB2BulkCopy salesCopy = new DB2BulkCopy(conn);
salesCopy.DestinationTableName = "SALES";
try
{
salesCopy.WriteToServer(source);
salesCopy.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Exception");
}
}