Jump to content
KevinKor

MultiDimensional Array with ArraysHelper

Recommended Posts

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. 

Share this post


Link to post
Share on other sites

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 by OlmanQuesada

Share this post


Link to post
Share on other sites

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 by KevinKor

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use