What am I doing wrong ???
The 9th parameter of "GetMultiAsDataTable" keeps producing a runtime error of "Object reference not set to an instance of an object."
I have tried passing "null" and a Transaction as below - both produce the same error.
I do not need a transaction, I just want this to work...
[NB This is running in .NET 2.0]
DataTable ResultData = null;
TypedListDAO DataList = null;
ResultsetFields Fields = null;
IRelationCollection Joins = null;
IPredicate Filter = null;
ISortExpression SortOrder = null;
Fields = new ResultsetFields(8 );
Fields.DefineField(StudycontractFieldIndex.Studycontractuid, 0, "SCUID");
Fields.DefineField(StudycontractFieldIndex.Stcocontractid, 1, "Contract ID");
Fields.DefineField(OtentryFieldIndex.Oteuid, 2, "OTEUID");
Fields.DefineField(OtentryFieldIndex.Otenametext, 3, "OTE Name");
Fields.DefineField(SccomponentFieldIndex.Sccomponentuid, 4, "SCCUID");
Fields.DefineField(SccomponentFieldIndex.Sccomshortnametext, 5, "SC Name");
Fields.DefineField(OtcomponentFieldIndex.Otcuid, 6, "OTCUID");
Fields.DefineField(OtcomponentFieldIndex.Otcshortnametext, 7, "OTC Name");
Joins = new RelationCollection();
Joins.Add(OtentryEntity.Relations.StudycontractEntityUsingOteuid);
Joins.Add(SccomponentEntity.Relations.StudycontractEntityUsingStudycontractuid, JoinHint.Left);
Joins.Add(OtcomponentEntity.Relations.SccomponentEntityUsingOtcuid);
Filter = PredicateFactory.CompareValue(OtentryFieldIndex.Otereportingyear,
ComparisonOperator.Equal,
Int32.Parse("2004"));
SortOrder = new SortExpression();
SortOrder.Add(SortClauseFactory.Create(OtentryFieldIndex.Otenametext, SortOperator.Ascending));
SortOrder.Add(SortClauseFactory.Create(OtcomponentFieldIndex.Otcshortnametext, SortOperator.Ascending));
Transaction Txn = new Transaction(IsolationLevel.ReadCommitted, "AServer");
DataList.GetMultiAsDataTable(Fields, ResultData, 0, SortOrder, Filter, Joins, true, null, Txn, 0, 0);