I want to add functionality to easily fetch scalar data from a service using custom SQL.
I implemented a client side function:
public static T GetScalarValueWithCustomSQL<T>(IDataAbstractService service,string sql) where T:new()
{
RemObjects.SDK.Types.Binary tabledata=service.SQLGetData(sql,true /*false*/, -1);
var dataTable=DB2RemObjectsUtil.GetDataTableFromROBinary(tabledata, null);
<... return column 0 of row 0>
}
However deserializing the Binary to a DataTable fails
If I run SQLGetData aIncludeSchema=False then I get error ‘Cannot find schema for table in stream received from server: SQLResult’
With aIncludeSchema=true the streamer.ReadDataTable function throws error ‘DataColunn needs a name’ (unless I explicitely name my aggregate column)
Can this be prevented?
FYI: I call ReadDataTable with argument applySchema=true (which is required I presume)
In C# .NET this does not compile.
The types are different IDataAbstractLocalServiceAccess & IDataAbstractService
error CS1503: Argument 1: cannot convert from ‘RemObjects.DataAbstract.Server.IDataAbstractService’ to ‘System.ComponentModel.IContainer’
error CS0266: Cannot implicitly convert type ‘RemObjects.DataAbstract.Server.IDataAbstractService’ to ‘RemObjects.DataAbstract.Server.IDataAbstractLocalServiceAccess’. An explicit conversion exists (are you missing a cast?)