Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way?
Message
 
To
27/11/2002 11:49:52
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Miscellaneous
Thread ID:
00727347
Message ID:
00727625
Views:
9
Jim,

With ADO.NET, not much is done automatically. You need to set the CommandText property of the DataAdapter to the Command object that either has your stored procedure or your Update statement to execute against the backend.
Dim cmd As New SqlCommand("MyUpdateSP", cnn)
cmd.CommandType = CommandType.StoredProcedure
Dim prm As SqlParameter = _
	cmd.Parameters.Add("@Parm1", "MyValueToPass") 
MyDA.UpdateCommand = cmd
Here is a link to a whitepaper I wrote about ADO.NET that explains how to perform these kinds of procedures:

http://prenia.com/downloads.htm

Click on "Introduction to ADO.NET for Visual FoxPro Developers"

>Cathi,
>
>It says I have to set the commandtext property for the update command. I am assuming that the update method for the data adapter uses a stored procedure to do the update and automatically sets any parameters required by the stored proc. Is this correct?
>
>Jim
>
>>Jim,
>>
>>The sample code was if you needed to change the data other than in bound controls. In your case, just call the Update method of the DataAdapter to perform the update on the backend. Depending on how you are working with the DataGrid, you might need to call EndEdit method prior to performing the Update.
>>
>>>Hey Cathi,
>>>
>>> Thanks for the reply. The user will be making the changes in a datagrid. So can I just call the update command on the dataadapter or do I have to code the changes for all the fields like you are doing?
>>>
>>>Jim
>>>
>>>>Hi Jim,
>>>>
>>>>Look at Message #724589 for examples about how to update data in the DataSet to the backend.
>>>>
>>>>>Bonnie,
>>>>>
>>>>> I want to add data from an existing DataSet to a table that exists on your back-end database.
>>>>>
>>>>>Jim
>>>>>
>>>>>>Hi Jim,
>>>>>>
>>>>>>I'm not sure what you're asking ... do you want to add data from an existing DataSet to a table that exists on your back-end database? Or do you have existing data in a DataTable that you want to add to your DataSet?
>>>>>>
>>>>>>~~Bonnie
>>>>>>
>>>>>>
>>>>>>>All,
>>>>>>>
>>>>>>> I have a dataset that I want to add to an existing table selected by the user. Is there an easy way to do this? Are there any articles about this?
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform