Problème avec string[]:cannot implicitly convert type 'string' to 'string[]'
Salut à vous tous,
Voila, Je voudrai réaliser un web service qui renvoi un table de string(affichage des noms), Mais lorsque je debug il m'affiche l'erreur suivante:
Citation:
Cannot implicitly convert type 'string' to 'string[]'
et voila le code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
private void Form1_Click(object sender, EventArgs e)
{
MySW.ServiceSoapClient mySoap = new MySW.ServiceSoapClient();
// ici l'erreur
string[] myReturnedStrings = mySoap.SomeMethod();
MessageBox.Show("Result:", myReturnedStrings[0],
myReturnedStrings[1]);
} |
Web Service
Code:
1 2 3 4 5 6 7 8
|
public string[] SomeMethod()
{
string[] myStringArray = new string[2];
myStringArray[0] = "Hello";
myStringArray[1] = "Goodbye";
return myStringArray;
} |
Merci de vos conseils
Cordialement