Hello, I have an n by n String array that needs to be outputted to a web page, I have found some solutions that require many many (read: many) lines of code (usually converting it to a DataTable then binding to a GridView). And almost all of these solutions will not even work for the dynamic nature of my arrays (I do not know ahead of time how many columns and rows are going to be generated, nor the names of the columns: it's user controlled).
I find this to all of these solutions to be somewhat ridiculous and in some cases larger than my whole module that I have already designed, simply to output a small piece my data...
This is an example of what I have tried to do:
object1 = (string[,]) r.GetSymbol("stringArray"); //I retrieve n x n array and cast as a string contained in an object (have to do this because I am using COM interfaces).
Output_GridView.DataSource = object1; //(If I try to convert this to a string, it returns the dataType "string" not the 2d array
Output_GridView.DataBind();
This doesn't work (it would require a 1d array according to the error I get, I don't know why DataSource/GridView would be limited like this), I have read up on some very ugly solutions to it, but really, all I need is to just write a nested for-loop to output n columns and n rows to the ASP.NET page. Can someone help me out here (why does such a trivial task have to be so difficult?)
Thank you for any feedback =)
-Dave