我正在尝试编写几个扩展来将UniDataSets和UniRecords转换为DataSet和DataRow但是当我尝试编译时出现以下错误.
‘System.Data.DataRow.DataRow(System.Data.DataRowBuilder)’ is inaccessible due to its protection level
有没有办法解决这个问题,还是应该放弃这种方法并采用不同的方式?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data; using IBMU2.UODOTNET; namespace Extentions { public static class UniDataExtentions { public static System.Data.DataSet ImportUniDataSet(this System.Data.DataSet dataSet,IBMU2.UODOTNET.UniDataSet uniDataSet) { foreach (UniRecord uniRecord in uniDataSet) { DataRow dataRow = new DataRow(); dataRow.ImportUniRecord(uniRecord); dataSet.Tables[0].ImportRow(dataRow); } return dataSet; } public static void ImportUniRecord(this System.Data.DataRow dataRow,IBMU2.UODOTNET.UniRecord uniRecord) { int fieldCount = uniRecord.Record.Dcount(); // ADD COLUMS dataRow.Table.Columns.AddRange(new DataColumn[fieldCount]); // ADD ROW for (int x = 1; x < fieldCount; x++) { string stringValue = uniRecord.Record.Extract(x).StringValue; dataRow[x] = stringValue; } } } }