views:

55

answers:

1

I don't usually work with this type of data layer so I'm not familiar with all the terminology and it's difficult to search for answers.

I have an XSD file in Visual Studio 2005, and I'm looking at the GUI editor. I created a table adapter by dragging a stored procedure onto the form. That stored procedure is basically a SELECT statement with a few parameters. It seems that this has automatically populated the SelectCommand properties for the table adapter.

Now I want to bring in a stored procedure to populate the UpdateCommand properties. The only way I know of to do this is to open the properties pane for the table adapter and expand the UpdateCommand properties. From there I select StoredProcedure as the CommandType and I select the stored procedure from the CommandText dropdown.

At this point one would imagine it might import all of the parameters by analyzing the stored procedure, but when I go to the parameters collection, it's empty, and I seem to have to set up all 30 or so parameters by hand. Surely there must be a faster and less error-prone way to do this.

I imagine I'm missing something very fundamental. What is it?

+1  A: 

You could try to right-click the design surface and choose Add TableAdapter. Once you specify the connection to use, it will prompt you for how to fill in the commands. Specify to use existing stored procedures, and it will help you configure the parameters.

John Saunders
Thanks. More accurately though, I don't have the option to add a TableAdapter. I had to right-click the existing table adapter and go to "Configure."
strongopinions
You can't right-click the background? The design surface? You don't get an "Add" menu item? I was using VS2008, but I didn't think that had changed since VS2005. Are you running VS2005 SP1?
John Saunders