Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connecting to VFP Data in ASP.NET
Message
 
À
01/05/2006 17:16:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
01072118
Message ID:
01118240
Vues:
21
Cetin, so set cust_id field as datakeynames, and also read-only(of course) and that should work? Anything else I may have overlooked? You've done this?
-TB


>It should be referenced wıth a question mark.
>
>
>UpdateCommand="UPDATE customer SET company = ?, contact = ?, title = ? WHERE cust_id = ?"
>
>     <UpdateParameters>
>         <asp:Parameter Name="company" Type="String" />
>         <asp:Parameter Name="contact" Type="String" />
>         <asp:Parameter Name="title" Type="String" />
>         <asp:Parameter Name="cust_id" Type="String" />
>     </UpdateParameters>
>
What ever you're using set its DataKeyNames.
>Cetin
>
>>If I may revive an old thread as I'm in a jam trying to invoke an UPDATE COMMAND from .net on a vfp table. In my gridview my update uses parameters but I cannot figure how to capture the current record ID. Would you have a clue? r_id is the unique id but I guess it should not be referenced with a question mark.
>>UpdateCommand='update orders_web set office=?,noun=?,price=? where r_id=? '>
>> UpdateParameters
>> asp:Parameter Name="mlmca_nbr" /
>> asp:Parameter Name="moffice" /
>> asp:Parameter Name="mnoun" /
>> asp:Parameter Name="mprice" /
>> /UpdateParameters
>>
>>
>>
>>>Tim,
>>>Methods are not prohibited but I couldn't decipher your sample. Maybe there is something 2.0 specific in your code and I don't have it here yet.
>>>Cetin
>>>
>>>>In going the Vfpoledb route, is some foxpro syntax prohibited? for example
>>>>VDataSourceG.SelectCommand=" SELECT * from r:mytable WHERE recno() =40" works but how about statements like:
>>>>VDataSourceG.SelectCommand=" SELECT * from r:mytable where 'M-'" $method" ?
>>>>
>>>>
>>>>
>>>>>Yes it is expecting a parameter for country.
>>>>>
>>>>> <asp:SqlDataSource ID="vfpTestData" runat="server"
>>>>>   ConnectionString="< %$ ConnectionStrings:vfpTestDataConnection % >"
>>>>>   ProviderName="< %$ ConnectionStrings:vfpTestDataConnection.ProviderName % >"
>>>>>   SelectCommand="SELECT company, contact, country FROM customer WHERE (country = ?)">
>>>>>   <SelectParameters>
>>>>>      <asp:ControlParameter
>>>>>         ControlID="TextBox1" DefaultValue="" Name="country" PropertyName="Text" Type="String" />
>>>>>   </SelectParameters>
>>>>> </asp:SqlDataSource>
>>>>>
>>>>>Here: SqlDataSource sets datasource properties along with SelectCommand.
>>>>>Following that "SelectPameters" tag adds a ControlParameter with ID "TextBox1" and other properties. TextBox1 is a textBox on ASP form and at run time ? is replaced with its text. Maybe you don't have TextBox1 on asp form?
>>>>>
>>>>>UT is working well for me.
>>>>>Cetin
>>>>>
>>>>>
>>>>>>I hope you'll end up liking it, makes datasources/connections easier. As for the error, it didn't like WHERE (country = ?)
>>>>>>Is it looking for something in place of "?"
>>>>>>PS, is the UT experiencing errors, when I click "get the replies to my messages", I get a COM error.
>>>>>>
>>>>>>-T
"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