DataTable already belongs to another DataSet

后端 未结 10 1240
滥情空心
滥情空心 2020-12-24 11:14

This error is occuring while adding one datatable from a dataset to another .\"DataTable already belongs to another DataSet.\"

dsformulaValues.Tables.Add(m_D         


        
10条回答
  •  情深已故
    2020-12-24 11:44

    dtCopy = dataTable.Copy()

    ds.Tables.Add(dtCopy)

    We can Optimize the code like :

    ds.Tables.Add(dataTable.Copy());

提交回复
热议问题