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: 1971
Discussions: 200,511, Posts: 2,374,420, Members: 245,834
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
Is It Just Me? (1637)
windows 7 retail and rtm (5)
FT HOOD attack: 7 killed 12 injured (67)
Review My Build (6)
HELP!!! What do you think of this s.. (16)
Looking for a graphic card that wil.. (30)
Assosiations (21498)
My 1st pc build (40)
PC Modern Warfare 2: it's much wors.. (12)
Aero in Vista (7)
core i7 extreme 975, nvidia 9400gt (9)
How to Ship a PC (16)
Building my first computer (13)
[F@H SPAM 11/1/09]New month . . . n.. (33)
Recent Discussions
windows 7 retail and rtm (5)
New processor technical problem (0)
boot from CD-ROM in chipset via P4M80.. (2)
Powe Director v8 (0)
Windows Experience Index is screwed u.. (3)
Review My Build (6)
FAT32 to NTFS file system in Win2kpro (4)
Internet very slow since updating AVG.. (8)
Motherboards and my curse... (25)
HELP!!! What do you think of this sys.. (16)
New Processor, Monitor will not turn .. (2)
2009 Build (4)
My 1st pc build (40)
Freezing During Music/Movies (1)
ext. sound card laptop to stereo syst.. (2)
Remote Desktop via SSH and error mess.. (2)
Help and Support disappeared from my .. (0)
[F@H SPAM 11/1/09]New month . . . new.. (33)
Basic applications needed for "r.. (1)
core i7 extreme 975, nvidia 9400gt (9)
hard drive problem (2)
Win7 TrustedInstaller Permissions (2)
Speed up Win 7 boot time a bit (1)
Hard Drive test program (2)
wireless westell versalink model 327w (1)


All times are GMT -4. The time now is 09:42 AM.
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