Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > updating multiple tables

Reply
Thread Tools

updating multiple tables

 
 
evandela@bigpond.net.au
Guest
Posts: n/a
 
      03-21-2006
Hi all... this is one part of ASP.net that i just dont understand...
and GOD knows, i am trying.
I have 2 tables, the first one called country [countryID, countryName]
and the second called product[productID, countryID, productName]

I create a datagrid and have to custom write the sql Select command

Up to this point it all works fine... the hitch is that i also want to
be able to update the damned thing... here is the declaration of my
datasource... what do I need to do? please I am a newbie here... so
dont get to technical use easy words and if you have to swear at me,
dont use stars, I am likley going to think that is some sort of
variable and will try use it in some code...

<asp:AccessDataSource ID="countryList" runat="server"
DataFile="~/App_Data/products.mdb"
SelectCommand="SELECT country.*, product.* FROM country, product
WHERE country.countryID = product.countryID;"
ConflictDetection="CompareAllValues"
OldValuesParameterFormatString="original_{0}"
UpdateCommand="UPDATE Product SET [cost]=? WHERE [countryID]=? AND
[productID]=?">
<UpdateParameters>
<asparameter Name="cost" Type="int32" />
<asparameter Name="countryID" Type="int32" />
<asparameter Name="productID" Type="int32" />
</UpdateParameters>
</asp:AccessDataSource>

How does asp.net KNOW what values to put into the update parameters ?
and what do you guys think I am missing here ?

Evan

 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      03-21-2006
Evandela,

I can't really answer your question exactly, but I can point you to a
tutorial that I think may help your understanding:

http://msdn2.microsoft.com/en-us/library/ms178294.aspx

The link above is to a tutorial on adding a dropdownlist to the edit area of
a gridview control (all without coding) so that the items to choose from in
the gridview (linked via PrimaryKey) in the main table are selectable in the
dropdown and the primary key gets updated in the original table.

It should be a good start for you to understand what's going on. (I hope.)

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi all... this is one part of ASP.net that i just dont understand...
> and GOD knows, i am trying.
> I have 2 tables, the first one called country [countryID, countryName]
> and the second called product[productID, countryID, productName]
>
> I create a datagrid and have to custom write the sql Select command
>
> Up to this point it all works fine... the hitch is that i also want to
> be able to update the damned thing... here is the declaration of my
> datasource... what do I need to do? please I am a newbie here... so
> dont get to technical use easy words and if you have to swear at me,
> dont use stars, I am likley going to think that is some sort of
> variable and will try use it in some code...
>
> <asp:AccessDataSource ID="countryList" runat="server"
> DataFile="~/App_Data/products.mdb"
> SelectCommand="SELECT country.*, product.* FROM country, product
> WHERE country.countryID = product.countryID;"
> ConflictDetection="CompareAllValues"
> OldValuesParameterFormatString="original_{0}"
> UpdateCommand="UPDATE Product SET [cost]=? WHERE [countryID]=? AND
> [productID]=?">
> <UpdateParameters>
> <asparameter Name="cost" Type="int32" />
> <asparameter Name="countryID" Type="int32" />
> <asparameter Name="productID" Type="int32" />
> </UpdateParameters>
> </asp:AccessDataSource>
>
> How does asp.net KNOW what values to put into the update parameters ?
> and what do you guys think I am missing here ?
>
> Evan
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating Problem In Multiple Tables in VB.NET Naveed_786 Software 0 07-21-2010 12:21 PM
Updating JTable Atomically - block data changes while updating. news.rcn.com Java 2 12-10-2007 11:49 AM
bind multiple data tables from sql queries to multiple datacontainers? Daves ASP .Net 1 01-06-2006 04:17 PM
Updating multiple Tables =?Utf-8?B?SnVzdGlu?= ASP .Net 1 11-22-2004 01:16 PM
Updating Related Tables from Dataset Shiv ASP .Net 0 10-17-2003 01:37 PM



Advertisments