Another alternative is to use the BinaryFormatter.
eg :.
==
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
...
...
private string ConvertToBase64String(int[,] data)
{
BinaryFormatter formatter = new BinaryFormatter();
using(MemoryStream ms = new MemoryStream())
{
formatter.Serialize(ms, data);
byte[] res = ms.ToArray();
return Convert.ToBase64String(res);
}
}
private int[,] ConvertFromBase64String(string str)
{
byte[] res = Convert.FromBase64String(str);
BinaryFormatter formatter = new BinaryFormatter();
using(MemoryStream ms = new MemoryStream(res))
{
return (int[,])formatter.Deserialize(ms);
}
}
==
HTH,
Stephen
"Alex Munk" <Al******@discussions.microsoft.com> wrote in message
news:C7**********************************@microsof t.com...
I would like to be able to pass a 2-dimensional array to a function as a
string parameter. In the called function I would like to be able to convert
the string back into a 2-dimensional array. Example
Function1 {
int [,] TheArray[10,10];
Function2(TheArray.ToString();
}
Function2 (string parm) {
... In here I would like to be able to convert parm back into a
2-dimensional int array. How do I do this }
Appreciate your help,
Alex