I am working with SqlServer 2005, VS 2005 controls (FormView, Datagrid etc.), and LLBLGenPro 2.5's Adapter (DataSource2). Some of the tasks for my project involve creating pages to edit entries in a database. I am new to this and things are going relatively well, but I don't know anyone who is very familiar with the tools I am using so I am pretty much on my own. I was hoping someone(s) with experience working with asp.net and LLBLGen could give me some advice...
Some of the tasks for the project involve editing entries in a database. It is straightforward working with the .net controls to accomplish basic CRUD tasks, but things get a little fuzzy for me when deciding how to handle foreign key relationships. The database I am working with contains many relationships (1:n m:n etc.) and the info should almost entirely be displayed and edited on one page. For example (not actual data, only to demonstrate sample relationships):
A Business holds a Customer table with a 1:n relationship (a business has many customers). The Customer table holds info about their contactinfo. The contactinfo is stored in a CustomerAddress table, which references the customer and an Address table and may contain multiple addresses for the customer. The Address table is abstracted out so a BusinessAddress and CustomerAddress table can store specific info (again, just an example). So given a Customer entity, how would an experienced .net developer expose all the info for editing? I'll give some initial thoughts I have had (please advise, insult as necessary).
-
I could use a FormView to display a Customer entity, for foreign keys create a FormView or DataList for the CustomerAddress and filter out irrelevant entries. But wouldn't this require all the data to be loaded at once? If I use a FilterBucket are all the entries still loaded? I only have a small test dataset, so it is difficult to test load times.
-
I could create a view in SqlServer and use a TypedView... Should work, but how to handle 1:n relationships?
I apologize for writing a novel, but it seems like this is probably well-charted territory for many and I am probably doing many things completely wrong or the hard way. Any advice would be greatly appreciated.