Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ASP 2 detailsview and VFP
Message
De
07/02/2006 15:40:15
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
01091843
Message ID:
01094422
Vues:
13
The Parameters collection is a property of the OleDbCommand object. I'm not sure what your SqlDataSource1 object is, but the InsertCommand property of it is a string, not an OleDbCommand object.

I'm assuming this was all auto-generated for you, so you'll have to look at the generated code and see what needs tweaking, using the above information.

~~Bonnie




>Heres's where I'm at, I am doing an example exercise
> SqlDataSource1.InsertCommand = "INSERT INTO DISH (TITLE,TYPE_DISH) VALUES (?,?)"
> SqlDataSource1.InsertCommand.Parameters.Add("@MTITLE", Title)
> SqlDataSource1.InsertCommand.Parameters.Add("@MType_dish", Type_dish)
>
>ERROR::: 'Parameters' is not a member of 'String'.
>
>I have the AutoGenerateSelectButton=true. VWD is vis web developer, same as VisualStudio
>
>
>
>>Tim,
>>
>>Sorry I missed when you replied to me earlier ... I must have had the sound off on my computer. Anyway ....
>>
>>>I assume this requires a detailsview and using your code, it bombed out in VWD, like on this statement:
>>>SqlDataSource1.InsertCommand.Parameters.Add("@title", title);<

>>
>>You didn't say what the error message was. What is VWD? You may have to also include the OleDbDataType in the Parameter Add method.
>>
>>~~Bonnie
>>
>>
>>
>>
>>
>>
>>>>You want to use ? instead of @parameters, but then you need to add the parameters to the OleDbCommand in the order they are used (in other words, in VFP's OleDb provider, parameters are positional, not named). Something like this:
>>>>
>>>> InsertCommand="INSERT INTO Products (ProductName, SupplierID, CategoryID,
>>>>        QuantityPerUnit, UnitPrice) VALUES (?,?, ?, ?,?)"
>>>>
>>>>MyInsertCommand.Parameters.Add("@ProductName", MyProduct);
>>>>MyInsertCommand.Parameters.Add("@SupplierID", MySupplierID);
>>>>MyInsertCommand.Parameters.Add("@CategoryID", MyCategoryID);
>>>>//etc.etc.etc.
>>>>
>>>>
>>>Bonnie, I guess to make this easier is to have the user fill out some textboxes then insert the values as a new record into the DBF (using vfpoledb naturally). I assume this requires a detailsview and using your code, it bombed out in VWD, like on this statement:
>>>SqlDataSource1.InsertCommand.Parameters.Add("@title", title);
>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Anyone know how to apply an "insertcommand" in the detailsview? I am using VFPOLEDB to connect to the datasource. The examples I get always have the @var syntax as in this example:
>>>>>
>>>>> InsertCommand="INSERT INTO Products (ProductName, SupplierID, CategoryID,
>>>>> QuantityPerUnit, UnitPrice) VALUES (@ProductName,@SupplierID, @CategoryID, @QuantityPerUnit,CONVERT(money,@UnitPrice))">
>>>>>
>>>>>how does this apply to VFP table?
Bonnie Berent DeWitt
NET/C# MVP since 2003

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

Click here to load this message in the networking platform