Forum Discussion
Rather than "Value", you might want to use the GetChunk method. What you'll need to do is get the ActualSize of the field and then use GetChunk to retrieve it. I've not tested this but it might look something like this:
rs.MoveFirst(); var blobSize = rs.Fields("slices").ActualSize; var blob = rs.Fields("slices").GetChunk(blobSize);
Thanks Now I have gotten Blob object.
Second Issue is to Cast the Blob object in some list/dictionary type object of JavaScript for traversing. As I told you we have stored blob object type of System.Collection.Generic.List of Double.
I have found the following description of System.Collection.Generic.List that takes the "<CLRType> collection" object. I don't know how to define <CLRType> collection object.
Description: System.Collection.Generic.List`1 zctor_3(<CLRType> collection);
So far code looks like and I get type Mismatch error.
rs.MoveFirst(); var blobSize = rs.Fields("slices").ActualSize; var blob = rs.Fields("slices").GetChunk(blobSize); var objList = Aliases.appName.AppDomain("appUI.exe").dotNET.System_Collections_Generic.List_1.zctor_3(blob); // Gives "Type Mismatch Error"
- tristaanogre8 years agoEsteemed Contributor
if your Blob is an image, it's not a collection. A collection is an object that has fields and properties and items. At least, that's my understanding.
I don't know the specific collection object you are trying to use so I can't help you further.
- mugheessiddiqui8 years agoContributor
No Blob is not an image, it's an serialized object of System.Collections.Generic.List.
- AlexKaras8 years agoChampion Level 3
Hi,
I am not absolutely sure, but I think that you should:
-- Register relevant (system.dll?) .Net assembly in dotNet Bridge in TestComplete and
-- Use something like
var objList = dotNET.Syst
em_Collections_Generic.List_1.zctor_3(blob); in your code.
As a result, objList variable should contain deserialized list of doubles that cannot be used 'as is' in your test code and must be converted to array or delimited string or something like that that can be iterated and used in JScript.
- mugheessiddiqui8 years agoContributor
System.Collection.Generic.List included in mscorlib.dll and it is already available in Test Complete.
I think I have to deserialize the object but not sure how to do it.
- AlexKaras8 years agoChampion Level 3
Hi,
As it was suggested by HKosova, you should figure-out what is returned from Blob - this may be some string/base64 encoded string/xml/etc. Then you should find corresponding List constructor and use it to deserialize the returning value.
However, as it was also suggested by Helen, it may be easier/more convenient to create a simple .Net assembly with one function that will receive Blob ID and database connection string as input parameters, get Blob from the database, deserialize it and return the list as, say, CrLf-delimited string. I believe that you can easily get the above code from your developers.
Related Content
- 11 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 7 days ago