|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Query data from multiple tables and saving backHello,
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. -- Show quoteChristopher 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! > > 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! > > > > > > > If you're using SqlCommand, the CommandType property should be set to
StoredProcedure. -- Show quoteChristopher 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! >> > >> > >> >> >> 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! > >> > > >> > > >> > >> > >> > > > 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. -- Show quoteChristopher A. Reed "The oxen are slow, but the earth is patient." "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! |
|||||||||||||||||||||||