Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ASP 2 detailsview and VFP
Message
 
À
07/02/2006 14:12:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
01091843
Message ID:
01094420
Vues:
13
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?
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform