Home All Groups Group Topic Archive Search About

Query data from multiple tables and saving back

Author
30 Dec 2005 2:56 PM
mimo
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!

Author
31 Dec 2005 12:30 AM
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.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

Show quote
"mimo" <m***@discussions.microsoft.com> wrote in message
news:55074281-81FD-4B60-9875-6ABCEC0ECF08@microsoft.com...
> 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!
>
>
Author
5 Jan 2006 10:23 PM
mimo
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.

Show quote
"Christopher Reed" wrote:

> 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.
> --
> Christopher A. Reed
> "The oxen are slow, but the earth is patient."
>
> "mimo" <m***@discussions.microsoft.com> wrote in message
> news:55074281-81FD-4B60-9875-6ABCEC0ECF08@microsoft.com...
> > 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!
> >
> >
>
>
>
Author
6 Jan 2006 3:36 AM
Christopher Reed
If you're using SqlCommand, the CommandType property should be set to
StoredProcedure.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

Show quote
"mimo" <m***@discussions.microsoft.com> wrote in message
news:2BA10310-5923-4F74-8287-BC317E6243C9@microsoft.com...
> 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.
>
> "Christopher Reed" wrote:
>
>> 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.
>> --
>> Christopher A. Reed
>> "The oxen are slow, but the earth is patient."
>>
>> "mimo" <m***@discussions.microsoft.com> wrote in message
>> news:55074281-81FD-4B60-9875-6ABCEC0ECF08@microsoft.com...
>> > 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!
>> >
>> >
>>
>>
>>
Author
11 Jan 2006 3:19 PM
mimo
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.  :(

Show quote
"Christopher Reed" wrote:

> If you're using SqlCommand, the CommandType property should be set to
> StoredProcedure.
> --
> Christopher A. Reed
> "The oxen are slow, but the earth is patient."
>
> "mimo" <m***@discussions.microsoft.com> wrote in message
> news:2BA10310-5923-4F74-8287-BC317E6243C9@microsoft.com...
> > 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.
> >
> > "Christopher Reed" wrote:
> >
> >> 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.
> >> --
> >> Christopher A. Reed
> >> "The oxen are slow, but the earth is patient."
> >>
> >> "mimo" <m***@discussions.microsoft.com> wrote in message
> >> news:55074281-81FD-4B60-9875-6ABCEC0ECF08@microsoft.com...
> >> > 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!
> >> >
> >> >
> >>
> >>
> >>
>
>
>
Author
12 Jan 2006 3:08 AM
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.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

Show quote
"mimo" <m***@discussions.microsoft.com> wrote in message
news:F64270BD-6802-483A-A29C-E72C1228E159@microsoft.com...
> 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.
> :(
>
> "Christopher Reed" wrote:
>
>> If you're using SqlCommand, the CommandType property should be set to
>> StoredProcedure.
>> --
>> Christopher A. Reed
>> "The oxen are slow, but the earth is patient."
>>
>> "mimo" <m***@discussions.microsoft.com> wrote in message
>> news:2BA10310-5923-4F74-8287-BC317E6243C9@microsoft.com...
>> > 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.
>> >
>> > "Christopher Reed" wrote:
>> >
>> >> 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.
>> >> --
>> >> Christopher A. Reed
>> >> "The oxen are slow, but the earth is patient."
>> >>
>> >> "mimo" <m***@discussions.microsoft.com> wrote in message
>> >> news:55074281-81FD-4B60-9875-6ABCEC0ECF08@microsoft.com...
>> >> > 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!

AddThis Social Bookmark Button