Problems about TableMappings.Add's first parameter

xiaoxiao2021-03-31  207

Multiple trials found that the first parameters of the THISDATADAPTER.TABLEMAPPINGS.DATAADAPTER.TABLEMAPPINGS.ADD method of the DA layer can only be "Table", "Table1", "Table2" ..., and case should be consistent. SP returns a result set with "Table", returns two result sets, using "Table", "Table1". Push it in this class.

Example: this.dataadapter.tablemappings.add ("table", updateconfirmdat.parentrecord.tablename); this.dataadapter.tableMappings.add ("table1", updateconfirmdat.parentRecordCount.tableName);

Investigating the cause,

In オブジェ ト ト ブ ウザ ウザ ウザ 到 第一 参 参,,,,........,....................... Also, the Fill method for the DBDataAdapter used in the base class has the following description.

Public override system.int32 fill (system.data.dataset dataset) system.data.common.dbdataadapter の メ メ メ バ

Summary: System.Data.DataSet Name 使用 て て 行 行 行 に に に に に に に に に に に に に に に

Additional た は update し. ,,, 名 s s....

パ パ メ タ: Dataset: レコ レコ ド および および 応じ 応じ キ キ キ マ す め め s め め め マ め め s s め め キ s 応じ め め s s キ s s s マ s に s s s s マ に s に s に s s に s

戻 戻 値: system.data.dataset Normal に Add は は 更 更 行 行..これ に, 行 行 さ テ テ テ テ メ ト 行 行 行 行.. 含 含 含 含 ま 含 含 含 含 ま れ 含 れ 含 れ れ れ せ せ れ せ れ せ れ ま れ ま ま ま ま ま ま れ れ ま ま ま れ ま ま せ ま ま ま ま れ せ ま ま れ ま ま ま ま ま ま

My understanding, the TableMappings.Add method is to map the table in the デ タ タ ソ ス (database) to the table in the DataSet. The Fill (System.Data.DataSet DataSet method performs the specified SQL text and extracts the data from the デ タ ソ ソ ス table to the DataSet table. But this is just for a single table query, does not apply to multi-table query and use stored procedures. Since the result set returned by the stored procedure does not have a corresponding デ タ ソ ス ス table, the Fill method is made in the backpoints in the backpoints in "Table", "Table1", "Table2" ... for the name of the DataTable. Then add or update it to the DataSet according to the mapping in TableMappings.

Therefore, when the ADD table name in TableMappings, the table should be set in the order of the query result set in the called SP.

Also, if you want to change the "table" mapping target table in TableMappings, you can use the following statement:

DataAdapter.TableMappings ["Table"]. DataSetTable = Dataset.DataTable.tablename

Find a little post on 9CBS and give some inspiration.

TABLENAME INST in DataSet?

http://community.9cbs.net/expert/topic/4295/4295686.xml?temp=.783169

转载请注明原文地址:https://www.9cbs.com/read-130961.html

New Post(0)