gicio Posted March 2, 2003 Posted March 2, 2003 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!! Quote
Leaders quwiltw Posted March 3, 2003 Leaders Posted March 3, 2003 I think I'd use the wizard in VS.NET to create a typed dataset with all the tables in it for now. I wouldn't actually use this, but it'll give a good idea of where to go from there. This page has a tutorial on Data and ADO.NET -> Working with Relational Data that should prove useful. http://samples.gotdotnet.com/quickstart/howto/ I guess the jury is still out on how exactly people are using datasets in their apps and what the best practices are but I'm starting to not use typed datasets and doing more of a pseudo-typed dataset, similiar to Duwamish. Of course this involves manually maintaining them but it's worked well so far without the bloat of typed datasets. This allows you to only build the datatables you need at any given time too. Quote --tim
gicio Posted March 3, 2003 Author Posted March 3, 2003 thanks!! another question: Is it possible to select all data from DB with one statement and fill the DataSet? gicio Quote
Leaders quwiltw Posted March 3, 2003 Leaders Posted March 3, 2003 Sure. This is especially easy if your database contains only one table;) On a serious note, I can't imagine why you'd want to do that. I don't know if there's a quick way to do it either, but I doubt it. I'll look closer if you have a convincing reason why you'd want to do it.:) Quote --tim
*Experts* Nerseus Posted March 3, 2003 *Experts* Posted March 3, 2003 I know you can do this in SQL Server with no problem. When you create your DataAdapter's sql string, you just put in multiple SELECT statements or use a proc that has multiple SELECT statements. I'm not sure if Access will allow this or not, but I think it will. I'd give it a try - start with two tables and separate each SELECT with a semicolon (I think that's what Access uses). SELECT CarID, Manufactore, Colour, Hp, Displacement, Price, Mode FROM Car; SELECT SaleContractID, CarID FROM SaleContractCar Let me know if this doesn't work - I don't have Access installed right now, but I can get it on pretty quick. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.