Hi, Frans!
I am hoping you can tell me what I am doing wrong with the following code. I appreciate your help in advance.
I am trying to specify the columns that I want to return from my Table by using the GetMultiAsDataTable method and here is how my code looks like:
...
VendorPriceDAO vendorPrice = new VendorPriceDAO();
ResultsetFields fields = new ResultsetFields(2);
fields.DefineField(ApplicationData.VendorPriceFieldIndex.VendorPrice, 0, "VendorPrice");
fields.DefineField(ApplicationData.VendorPriceFieldIndex.ItemNumber, 1, "ItemNumber");
DataTable dt = new DataTable();
bool result = vendorPrice.GetMultiAsDataTable(fields, dt, 0, null, null, null, false, null, null, 0, 0);
...
I have no problems running this code and the boolean result is true after the execution of the statement. However, when I look into the dt (dt.Rows) there are no rows. Also dt.Columns has no columns either.
I have also tried to add the following to see if it would have any impact but I still did not get any rows in the dt.Rows:
DataTable dt = new DataTable("VendorPrice_t");
dt.Columns.Add("VendorPrice", System.Type.GetType("System.Decimal"));
dt.Columns.Add("ItemNumber", System.Type.GetType("System.String"));
Can you help me why I am not getting any data into my DataTable dt?
PS When I do this;
DataTable dt = vendorPrice.GetMultiAsDataTable(0, null, null, null, 0, 0);
I get three rows, so I know my connection, etc. is correct.
Hakan