on 01-08-2014 3:07 PM
Hello Expert.
I used to use below code to convert SBO RecordSet to C# DataTable :
public static System.Data.DataTable AddOnSetTableSboRS2NetDT(string tableName, SAPbobsCOM.Recordset oRecordSet)
{
string dtName = tableName.Trim().Length > 0 ? tableName.Trim() : "Table1";
System.Data.DataTable dataTable = new System.Data.DataTable(dtName);
foreach (SAPbobsCOM.Field field in oRecordSet.Fields)
dataTable.Columns.Add(field.Name, typeof(string));
while (!oRecordSet.EoF)
{
System.Data.DataRow row = dataTable.NewRow();
foreach (SAPbobsCOM.Field field in oRecordSet.Fields)
row[field.Name] = field.Value;
dataTable.Rows.Add(row);
oRecordSet.MoveNext();
}
return dataTable;
}
However, I think it is not good way to convert SBO RecordSet to C# DataTable.
Above code has a performance problem.
I have two questions :
1. Convert SBO RecordSet to C# DataTable
2. Convert SBO DataTable to C# DataTable
Does anybody have good experiences as I write above questions?
Have a good day and thank you for reading.
Hi Chan,
This is not the right forum...
Answer is export in xml from side and import as xml on the other.
Regards,
Eric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
105 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.