|
No, because it's not possible. I want to take the query string passed into my web page, and cast it to The Great Gatsby. This literary classic is, after all, just string text, so this should by all means be possible. Obviously, it's not.
A data table isn't just a 2 dim array. That's true in the sense that the implementation details are different, but more importantly for what you're trying to do, it's true in the sense that DataTable doesn't inherit from Array. You can cast everything to System.Object, because everything ultimately inherits from System.Object, but array is a type that specialized from a general object, and you can only cast an array into things that are along the same inheritance tree.
If you want to share your goal, there might be another solution. I'm big on generic dictionaries, but that's probably getting into too much detail. I'm guessing it's a large spread sheet, if it's taking too long to load a data table. I'm also guessing you're doing this early on in a request, per request. Can you cache it at the session or application level?
|