Query data from multiple tables and saving back

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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.
 
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.
 
If you're using SqlCommand, the CommandType property should be set to
StoredProcedure.
 
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. :(
 
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

Back
Top