Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

TableAdapter.Update with stored procedure

vchegwiddenJun 21 2011 — edited Jun 22 2011
I've got a designer generated DataTable that uses a stored procedure to retrieve info from a table using a ref cursor.
I use the tableAdapter.Fill method and I can get the required values in my data table and use that in a datagridview.

Now I want to add another SP to the DataTable's update method so that when someone edits the values in the grid
I can save those changes back to my database as I would with a normal DataTable using TableAdapter.Update(DataSet.DataTable).
The problem is, from what I've read, I can't pass a DataTable to an oracle stored procedure because I can't create a ref
cursor in C#. What would be the best way to do this? I've read that I should use either Array Binding or XML, but how would
I go about doing this, keeping in mind that I would still like to use the designer to create typed datasets.

I'm using ODP.net, Oracle 11g database, Visual studio 2008

Thanks

Comments

SURFThru
You could make all the columns as parameters in the update stored procedure.

Then on your table adapter add the call to the update stored proc. Name the update prc_your_update_name. Then in your code you can just run ta.prc_your_update_name(field1,field2,....). Not sure if this is what you are looking for and maybe you want to avoid typing all the colunms as paramters.

Edited by: SURFThru on Jun 22, 2011 1:45 PM
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 20 2011
Added on Jun 21 2011
1 comment
2,135 views