Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Field passing
Message
De
15/02/2006 12:46:06
 
 
À
15/02/2006 12:26:43
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Divers
Thread ID:
01096481
Message ID:
01096535
Vues:
15
OK, first of all, your ConvertFields() method should be accepting an object (since that's what you're passing it):
ArrayList ConvertField(object theData)
{
  ArrayList result = new ArrayList();
  result.Add(theData);
  return result;
}
~~Bonnie

>I get the compile error when I call the method. Is there something different to do when passing an array as a parameter?
>
>Here's the code I have now:
>
>// server is defined elsewhere and is working just fine. One row is returned in ds
>DataSet ds = server.GetDemoByPk(100);
>
>// Two errors occur on the next line
>ArrayList dso = ConvertField(ds.Tables["Demo"].Rows[0][10]);
>
>// ConvertField is defined in the same class as the above code
>ArrayList ConvertField(byte[] theData)
>{
>  ArrayList result = new ArrayList();
>  return result;
>}
>
>
>Error 1:
>The best overload method match for 'ConvertField(byte[])' has some invalid arguments.
>
>Error 2:
>Argument '1': cannot convert from 'object' to 'byte[]'
>
>I tried casting the field to byte[], then got the following error on the same line:
>An object reference is required for the nonstatic field, method, or property 'ConvertField(byte[])'
>
>>And what line gives you the error message?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform