none
INSERT to DataSet but not Database with imported stored procedure RRS feed

  • Question


  • I created a stored procedure (called SET103T) in my database using management studio. This stored procedure inserts many lines into the PartDetails table.
    My visual basic 2008 project uses a Typed DataSet which incorporates all the tables from the DB and my stored procedure. My question is: How can I use my stored procedure from inside my VB code to only insert all the lines in the dataset. Currently, when I use SET103T it instantly inserts all the lines in the actual database. I want the users to be able to view the result from the stored procedure (and maybe make some changes) and then commit the changes to the database. Is it possible to use the stored procedure and tell it to insert the lines in the dataset and only after that to copy those to the sql 2005 database? Thx for any help you can offer.
    Monday, July 7, 2008 1:38 AM

All replies

  • When I import the stored procedure, it is attached to a new QueriesTableAdapter. In my code, I can use:

     

    Dim QueriesTableAdapter1 As New localOMSDataSetTableAdapters.QueriesTableAdapter

     

    Me.QueriesTableAdapter1.SET103T("parameters")

     

    The problem is that when this code is executed, it instantly inserts the lines to the database. I am not sure I understand completely the nature of the tableadapter. Are all tableadapters used to make instant changes to the database? If yes, Should I create a datatable and insert the lines into it and only later tell the program to copy the changes into the real database?

    Monday, July 7, 2008 1:32 PM