I want to return an array of Strings in the form \"abc#xyz#ghi#tru\" (where # is delimiter) from my web service method . However i m not able to do it . Here is my current web s
First, your query returns only number instead of set of rows. So you should use sql like this:
select name from names
Second, to return array you could use List instead of pre-defined arrays: I would be use the following approach:
var result = new List();
while(myReader.Read())
{
result.Add(reader["name"].ToString() + "#");
}
return result.ToArray();
Or if you want to return a string:
return string.Join("#", result.ToArray())