Query data from multiple tables and saving back

G

Guest

Hello,

I have seen samples on how to pull data from one table and save back to it
using the Form View control.

How do I pull from multiple tables and save back to multiple tables on one
screen? Is there a sample of this somewhere?

For example I want to create a Name and an Address from one screen. It has
to create a Name Record, a Name Address Record, and a NameAddressJoin Record.


Is there a sample of this so I can see how to pull form multiple tables and
update to them? I did write a query to pull from them, but when I go to save
how to I list multiple update and insert statements?

Thanks!
 
C

Christopher Reed

You can always use a stored procedure that contains multiple statements.
You would pass a common set of parameters and only use them with updating
and/or inserting into the appropriate table. Additionally, if necessary,
you can also acquired any identity column value necessary to populate a
second table that's a child to the first.
 
G

Guest

Is there a good sample of this somewhere? I wrote stored procedures to
populate, update, insert, and to save the form but some reason it isn't
working I'm wondering if I have to do something in ASP.NET to make them run
correctly. All the stored procedures run in Query Analyzer fine.
 
C

Christopher Reed

If you're using SqlCommand, the CommandType property should be set to
StoredProcedure.
 
G

Guest

Is there a sample of this somewhere? I'm using the GridView wizards so I am
not writing any code to do this but the Wizards never seem to work for me. :(
 
C

Christopher Reed

Look at the Quick Starts tutorials. I believe you can access them
www.asp.net .

With GridViews, you'll probably use the SqlDataSource, so the attribute in
question is the SelectCommandType.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top