home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2790
Discussions: 188,385, Posts: 2,243,513, Members: 232,615
Old March 2nd, 2003, 05:10 PM   Digg it!   #1 (permalink)
Member
 
Join Date: Oct 2002
Posts: 71
ADO.NET and Relational Data problem.....how start?

Hi!

I will write an application that work with an Access DB.
My database have 5 table that have a relationship to each other.

tables in DB:

Table 1: Car: CarID, Manufactore, Colour, Hp, Displacement, Price, Model
Table 2: SaleContractCar: SaleContractID, CarID
Table 3: SaleContract: SaleContractID, CustomerID, Date
Table 4: Customer: CustomerID, CustomerAddressID, Tel, Age, SeconCar, Name
Table 5: CustomerAddress: CustomerAddressID, Street, StreetNr, Zip, City

relationship between the tables:

Table 1 (one to more) Table 2
Table 2 (more to one) Table 3
Table 3 (more to one) Table 4
Table 4 (more to one) Table 5


at this moment I don't know how to start.

should I first load all tables I one DataSet?
and create for each table a DataTable?

how I should start?
how I should write an update SQL statement for this DataSet?

where I can find some sample application that work with Relational Data?


thx!!

gicio is offline   Reply With Quote
Old March 3rd, 2003, 12:36 AM     #2 (permalink)
Member
 
Join Date: Sep 2002
Posts: 364
It depends on what you are looking to do with the data. One thing is, as far as the update statement, you really write it for the Data Adapter, not the DataSet. If you drop the Data Adapter onto the form, it will create the Update command for you, if it can (won't be able to if the underlying DB doesn't have a primary key).

I am thinking that you will be using this to enter in data, using parent/child data entry concepts. In the case of Access, this would be somewhat difficult for me as far as creating new records. If you entered a parent record, then wanted to add child records to it, you wouldn't know which record you created in the parent table. This is easily resolved in SQL Server using a stored procedure to get the ID back, but Access is different.

If I was you, I would use the Data Form Wizard and look at the code they generate, and use some of the concepts from that.

Creosote is offline   Reply With Quote
Old March 3rd, 2003, 03:55 PM     #3 (permalink)
Member
 
Join Date: Oct 2002
Posts: 71
thanks!!


another question: Is it possible to select all data from DB with one statement and fill the DataSet?


gicio

gicio is offline   Reply With Quote
Old March 3rd, 2003, 08:56 PM     #4 (permalink)
Member
 
Join Date: Sep 2002
Posts: 364
That would depend on how the db is setup. If you used a Join statement to select it, then it probalby wouldn't be updatable. And you might not have proper columns to join some tables on as well.
Creosote is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

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

Most Active Discussions
Is It Just Me? (2897)
CPU wont boot (7)
3-days in and no threads about Gaza (160)
I think I just killed my computer w.. (24)
hp compaq nc6000 problems (139)
Upgrading RAM (5)
Folderchat Weekday thread (442)
Antec 300 bulk purchase? (11)
Worth the upgrade?? (15)
Recent Discussions
New Build ( Finally ) (3)
CPU wont boot (7)
Problem With LightScribe DVD Dr.. (0)
GLaDOS is up. (3)
HP notebook reinstall Vista NO .. (5)
Building a gaming computer advi.. (4)
hp compaq nc6000 problems (139)
Folderchat Weekday thread (442)
Creative T-3000 Subwoofer (3)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 10:55 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28