473,569 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

updating multiple tables

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:AccessData Source ID="countryList " runat="server"
DataFile="~/App_Data/products.mdb"
SelectCommand=" SELECT country.*, product.* FROM country, product
WHERE country.country ID = product.country ID;"
ConflictDetecti on="CompareAllV alues"
OldValuesParame terFormatString ="original_{ 0}"
UpdateCommand=" UPDATE Product SET [cost]=? WHERE [countryID]=? AND
[productID]=?">
<UpdateParamete rs>
<asp:Paramete r Name="cost" Type="int32" />
<asp:Paramete r Name="countryID " Type="int32" />
<asp:Paramete r Name="productID " Type="int32" />
</UpdateParameter s>
</asp:AccessDataS ource>

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

Evan

Mar 21 '06 #1
1 1546
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
<ev******@bigpo nd.net.au> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.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:AccessData Source ID="countryList " runat="server"
DataFile="~/App_Data/products.mdb"
SelectCommand=" SELECT country.*, product.* FROM country, product
WHERE country.country ID = product.country ID;"
ConflictDetecti on="CompareAllV alues"
OldValuesParame terFormatString ="original_{ 0}"
UpdateCommand=" UPDATE Product SET [cost]=? WHERE [countryID]=? AND
[productID]=?">
<UpdateParamete rs>
<asp:Paramete r Name="cost" Type="int32" />
<asp:Paramete r Name="countryID " Type="int32" />
<asp:Paramete r Name="productID " Type="int32" />
</UpdateParameter s>
</asp:AccessDataS ource>

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

Evan

Mar 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2601
by: Ken | last post by:
Help! I have a MS Access database made up of a single table. The data updates for this database comes in the form of a single Excel spreadsheet, which is imported into the database table. I need to break-out this single database table, into multiple tables to better structure the database and reduce the need to input the same data...
1
2569
by: Justin | last post by:
What is the best/easiest way to update multiple tables at a time? Can you recommend any tutorials? Thanks, Justin.
0
1629
by: cwbp17 | last post by:
I'm having trouble updating individual datagrid cells. Have two tables car_master (columns include Car_ID, YEAR,VEHICLE) and car_detail (columns include Car_ID,PRICE,MILEAGE,and BODY);both tables have a FK relationship on CAR_ID so the oracledataadapter1 select statement(CommandText) is: select car_master.car_id,...
34
10788
by: Jeff | last post by:
For years I have been using VBA extensively for updating data to tables after processing. By this I mean if I had to do some intensive processing that resulted in data in temp tables, I would have VBA code that wrote the results of that away to the db, either creating new records or updating existing records, whichever was relevant. This may...
33
3268
by: bill | last post by:
In an application I am writing the user can define a series of steps to be followed. I save them in a sql database using the field "order" (a smallint) as the primary key. (there are in the range of 20 steps) On the admin page the steps are listed, in "order" order and the user can create new steps and assign an order and all is well. ...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.