KevinKor Posted November 2, 2017 Report Share Posted November 2, 2017 When attempting to cast multidimensional arrays, I get the error, "Additional information: AIS-Exception. Cannot cast a System.String[,] to a System.String[]". This occurs in the ArraysHelper class, under the method, "public static TA CastArray<TA>(Array srcArray) where TA : class". The method works fine when passing single dimensional arrays. Link to comment Share on other sites More sharing options...
Mobilize.Net Staff OlmanQuesada Posted November 2, 2017 Mobilize.Net Staff Report Share Posted November 2, 2017 Hi Kevin, Could you send us a code sample where this error is happening? Please includes all variables definitions. Regards, OlmanQ Link to comment Share on other sites More sharing options...
KevinKor Posted November 2, 2017 Author Report Share Posted November 2, 2017 Error occurs on line 74. Comments above, from line 69 -71. Thanks, Kevin VBUC_CastArray_Sample.cs Link to comment Share on other sites More sharing options...
Mobilize.Net Staff OlmanQuesada Posted November 3, 2017 Mobilize.Net Staff Report Share Posted November 3, 2017 (edited) Thanks Kevin, Could you please include the definition of mobjEmployeeL2.EmployeeArray in both languages VB6 and C#, and the definition of astrGridData in vb6? OlmanQ Edited November 3, 2017 by OlmanQuesada Link to comment Share on other sites More sharing options...
KevinKor Posted November 6, 2017 Author Report Share Posted November 6, 2017 (edited) Hey Olman, Just discovered the small error - the class that in which the object is instantiated from has a property of a single dimensional array. It's now fixed, but I've attached snippet if you're still interested. Thanks, Kevin castArrayError.cs Edited November 6, 2017 by KevinKor Link to comment Share on other sites More sharing options...
Mobilize.Net Staff OlmanQuesada Posted November 6, 2017 Mobilize.Net Staff Report Share Posted November 6, 2017 Thanks Kevin, I'm glad to hear the issue is gone. As you mentioned, by just modifying the property return type would fix the issue. Cheers, OlmanQ Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now