Forum Stats

  • 3,784,352 Users
  • 2,254,928 Discussions


TableAdapter.Update with stored procedure

vchegwidden Member Posts: 2
edited Jun 22, 2011 4:46PM in .NET Stored Procedures
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, Oracle 11g database, Visual studio 2008



  • SURFThru
    SURFThru Member Posts: 24
    edited Jun 22, 2011 4:46PM
    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
This discussion has been closed.