home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

ADO.NET and Relational Data problem.....how start?

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1857
Discussions: 200,909, Posts: 2,378,942, Members: 246,277
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Why is Khalid Sheikh Mohammed even .. (6)
Is It Just Me? (2818)
California Passes Anti-Flat-HDTV Le.. (39)
Is the PSU I received dead? (10)
Install XP pro and a Vista laptop ?.. (8)
HIS HD5770 graphic card question (14)
A good PSU? (10)
Foreign voltage (7)
New Computer wont recognize XP disc (7)
Dept. of HS: NSA 'Helped' Develop V.. (12)
Print spooler problem (7)
Ideal cheap graph card for PC-Gamin.. (15)
EVGA 9800 gtx help with finding a g.. (7)
Modern Warfare 2: Who Bought It? (60)
Recent Discussions
Foreign voltage (7)
Asus P4G8X Mobo (3)
Print spooler problem (7)
windows vista security holes (2)
World's largest Monopoly Game using G.. (329)
EVGA 9800 gtx help with finding a goo.. (7)
Need hard disk drivers (4)
windows 7 internet problem (4)
What OS for a home server? (other tha.. (1)
Boot Problem? (0)
Logitech G9 laser gaming mouse $59.95.. (2)
$5 off any item with the purchase of .. (1)
Ideal cheap graph card for PC-Gaming? (15)
HIS HD5770 graphic card question (14)
Install XP pro and a Vista laptop ?? (8)
Cloning old drive to new drive (6)
Amptron monitor G17FP-Black (0)
A good PSU? (10)
Is the PSU I received dead? (10)
HP Pavillion Laptop ze4220 won't turn.. (7)
Dept. of HS: NSA 'Helped' Develop Vis.. (12)
Convert 5 pin Keyboard to USB (11)
hybernate option (2)
Steam ID's, Gamertags etc... (1)
New Computer wont recognize XP disc (7)


All times are GMT -4. The time now is 10:36 AM.
TechIMO Copyright 2009 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