Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFPOLEDB and Parameters
Message
De
30/06/2004 16:59:19
 
 
À
29/06/2004 22:30:19
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00918660
Message ID:
00919374
Vues:
7
Thanks to all of you for your replies. I found my problem and it was ME!

In my data service I was creating a new command object but did not duplicate the parameters collection. DUH!

>Hi Dan,
>
>Have you tried this?
>
>objCmd.Parameters.Add("CustomerID", OleDbType.VarChar).Value = "ALFKI"
>
>These documentation links might help:
>
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataOleDbOleDbParameterPropertiesTopic.asp
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataOleDbOleDbParameterCollectionClassAddTopic.asp
>
>>I've tried all combinations of adding the parameter. Nothing seems to work...
>>
>>>Hi Dan,
>>>
>>>This works in VFP. Maybe you can translate it into ASP.NET?
oCmd.CommandText = [select * from customers where CustomerID = ?]
>>>oPar = oCmd.CreateParameter("CustomerID", adVarChar, adParamInput, 6, "ALFKI")
>>>oCmd.Parameters.Append(oPar)
>>>oRs = oCmd.Execute()
>>>
>>>>I'm using the VFPOLEDB provider and I am creating a command object like this:
>>>>
>>>>
>>>>OleDbCommand objCmd = new OleDbCommand("select * from customers where CustomerID = ?");
>>>>objCmd.Parameters.Add("CustomerID", "ALFKI");
>>>>
>>>>
>>>>When I execute this command I am getting an OleDbException that says:
>>>>
>>>>
>>>>No value given for one or more required parameters.
>>>>
>>>>
>>>>How do I use the parameter collection to pass parementers to commands?
Thanks,
Dan Jurden
djurden@outlook.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform