Store a data datatable into dataset (DataSet. Merge method)

Source: Internet
Author: User

Today, a storage task was previously executed with multiple select statements in dataset and then stored in dataset. However, in c # moblie development, multiple Select statements cannot be executed simultaneously. Only one select table is saved to dataset once.
If DataSet. table. add (tablename); is used, we can only use the Merge method in Dataset.

String tb0sql = "select RateValue as MonthlyPreRate from WQtbRate_LimitedLv_MonthlyPreRate"; // monthlyprerate
DataTable dt0 = new DataTable ();
Dt0 = base. TableExecuteQuery (tb0sql, CommandType. Text );
Ds. Merge (dt0, false, MissingSchemaAction. Add );
Ds. Tables [0]. TableName = "xxxxxxx ";

The following describes the dataset. merge method DataSet. Merge.

Merges the array of the specified DataSet, able, or DataRow object into the currentDataSetOrDataTable.

Reload list

Name Description
DataSet. Merge (DataRow []) SetDataRowThe object array is merged to the currentDataSet.

Supported by. NET Compact Framework.

DataSet. Merge (DataSet) DataSetAnd its architecture are merged to the currentDataSet.

Supported by. NET Compact Framework.

DataSet. Merge (DataTable) DataTableAnd its architecture are merged to the currentDataSet.

Supported by. NET Compact Framework.

DataSet. Merge (DataSet, Boolean) DataSetAnd its architecture are merged to the currentDataSetIn the process,DataSet.

Supported by. NET Compact Framework.

DataSet. Merge (DataRow [], Boolean, MissingSchemaAction) SetDataRowThe object array is merged to the currentDataSetIn the process,DataSetAnd handle incompatible architectures.

Supported by. NET Compact Framework.

DataSet. Merge (DataSet, Boolean, MissingSchemaAction) DataSetIts architecture and currentDataSetMerge. In this process, the currentDataSetAnd handle incompatible architectures.

Supported by. NET Compact Framework.

DataSet. Merge (DataTable, Boolean, MissingSchemaAction) DataTableAnd its architecture are merged to the currentDataSetIn the process,DataSetAnd handle incompatible architectures.

Supported by. NET Compact Framework.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.