2.0 XSDs Using Stored Procedures

G

GaryDean

In a new 2.0 website I am developing I am using .XSD tableadapters, building
them with the wizard), and choosing the Stored Procedure option. I now
notice that when I go back to change the sql that I have no opportunity to
do so (as I do with regular sql). What is the recommended way to change an
..XSD using stored procedures? It doesn't seem I should directly change the
Stored Procedure as it works in concert with the generated methods in the
XSD, no?

More generally, what is the best practice here? I'm considering doing away
with the XSDs and just using straight stored procedures.
 
W

Walter Wang [MSFT]

Hi Gary,

A Stored Procedure may not only have SQL queries, it also could have
program logic there. Currenly the Visual Studio DataSet designer cann't
help you modify an existing Stored Procedure's logic, you will have to use
other database management tool to edit the Stored Procedure. Then you can
configure the DataSet to use the existing Stored Procedures accordingly.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

GaryDean

Walter,
When you say "Then you can configure the DataSet to use the existing Stored
Procedures accordingly. " What do you mean?
The classes that get generated still have the old values (even with regular
embedded sql they do!). I have found that I always need to delete the whole
XSD and start over any time a mod is needed -SPs or SQL. I'm wondering
about the value of these XSDs altogether - I'm thinking that the wizard may
be useful but I should then just take the SQL or the generated SPs and use
them in code. What do you think?
 
W

Walter Wang [MSFT]

Hi Gary,

What I meant is that you could:

1) Open the DataSet designer
2) Right-click on your DataSet, select "Configure"
3) In the "TableAdapter Configuration Wizard" dialog, you will see 4
combobox for the Select/Insert/Update/Delete operations, from each one you
could select an existing Stored Procedure to use. However you cannot change
the logic inside the Stored Procedure, you will have to use other database
management tool to modify it.


The value of the strong-typed DataSet is that it creates a TableAdapter for
you and the business objects are strong-typed.

TableAdapters are designer-generated components; they are analogous to
strongly typed data adapters. TableAdapters contain the necessary
information to connect to and query a database. For more information, see:


#TableAdapter Overview
http://msdn2.microsoft.com/en-us/library/bz9tthwx(VS.80).aspx


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top