I wrote simple code that generates random array of int's on webservice, i joined it with few buttons in html form but i cant achive propper output. Every time im invoeking the service im getting this output in my textbox "Macierze.myservice.ArrayOfInt[]". Anyone know how can i solve this and get full array in my textbox?
webservice code
[WebMethod]
public int[][] GenerateMatrix(int column, int row)
{
Random rnd = new Random();
int[][] matrix = new int[column][];
for (int i = 0; i < matrix.Length; i++)
{
matrix[i] = new int[column];
for (int j = 0; j < matrix[i].Length; j++)
matrix[i][j] = rnd.Next(1, 1000);
}
return matrix;
}
Button code
protected void Button1_Click(object sender, EventArgs e)
{
var serviceClient = new myservice.WebService1SoapClient("WebService1Soap");
output.Text = serviceClient.GenerateMatrix(Convert.ToInt32(input1.Text), Convert.ToInt32(input2.Text)).ToString();
}
ToStringcalled on jagged array returns. What is the proper output for you here? I am pretty sure it can be done with some LINQ