G
Guest
I am writing a fairly large database application for the first time, and am finding it difficult to decide on how to create the data access layer. I have tried reading as much as I can find about them on MSDN, but have found conflicting views, and am now really quite confused.
For example, I am using typed datasets to store my data in. I have created a data access layer class, that basically has a set of procedures that accept a dataset, and fill it with some sort of data. These functions are basically static and stateless.
Should the data access layer be stateful?
Should I instantiate a data access layer in my main() method at the start of my application that basically fills my dataset when I first load my app, and then just pass a reference to the data layer into my various forms?
I am finding it hard to know how to split up my database tables into datasets - just for the part I am working on now, I have about 20 tables, all of which are accessed from a single form. Should these just be in a single dataset? Or should I split them into smaller subgroups. The problem I see with this is that any relations between them will no longer exist! Also, if I have other forms that want to use just one or two of these 20 tables, should I create a separate dataset for them, or just use the reference to the data access layer and return the relevant tables?
Sorry about the length of this post, but any help with any of the issues here would be greatfully received. Any links to good reference material would be useful too.
Pete
For example, I am using typed datasets to store my data in. I have created a data access layer class, that basically has a set of procedures that accept a dataset, and fill it with some sort of data. These functions are basically static and stateless.
Should the data access layer be stateful?
Should I instantiate a data access layer in my main() method at the start of my application that basically fills my dataset when I first load my app, and then just pass a reference to the data layer into my various forms?
I am finding it hard to know how to split up my database tables into datasets - just for the part I am working on now, I have about 20 tables, all of which are accessed from a single form. Should these just be in a single dataset? Or should I split them into smaller subgroups. The problem I see with this is that any relations between them will no longer exist! Also, if I have other forms that want to use just one or two of these 20 tables, should I create a separate dataset for them, or just use the reference to the data access layer and return the relevant tables?
Sorry about the length of this post, but any help with any of the issues here would be greatfully received. Any links to good reference material would be useful too.
Pete