M
Matthew Hood
Here's the situation.
I am developing an ASP.NET web application. Most of my forms will be
accessing a database (MS Access) for either record
creation/deletion/updating or for list lookups. The problem I have is my
boss constantly wants to revise table and field names and I am the one that
has to make sure everthing works after the fact. What I want to do is
create 2 classes.
The first one is my "Record" wrapper class that will map to the table field
names. This is to provide me a consistant interface so when the database
field name is changed, all I have to do is change the field mapping in this
class.
The second class is my "Records" collection. I can create the database
methods myself, but I need to be able to set the rest of the interface up
and this is where I get a little confused. There are several different
collection objects available: array, arraylist, collection, dictionary...
I'm not sure what the best method is and how to go about implementing it.
What are your recomendations for this? I was able to do this easily in VB6,
but I'm not sure how to do it in .NET
1: I need to be able to use For Each Next... syntax
2: I need to be able to use either the Collection(Index as Integer) or
Collection(KeyName as String) methods to access an item.
3: I need to be able to strict types. Collection.Add(CollectionItem as
MyType)
4: Sorting is not needed. I will accomplish this in my SQL string.
4: Performance is an issue, but ease of use and functionality is a higher
priority.
Can anybody help explain what I need to do, and/or point me to some good
examples on the web where I can learn how to do it?
TIA,
-Matt
I am developing an ASP.NET web application. Most of my forms will be
accessing a database (MS Access) for either record
creation/deletion/updating or for list lookups. The problem I have is my
boss constantly wants to revise table and field names and I am the one that
has to make sure everthing works after the fact. What I want to do is
create 2 classes.
The first one is my "Record" wrapper class that will map to the table field
names. This is to provide me a consistant interface so when the database
field name is changed, all I have to do is change the field mapping in this
class.
The second class is my "Records" collection. I can create the database
methods myself, but I need to be able to set the rest of the interface up
and this is where I get a little confused. There are several different
collection objects available: array, arraylist, collection, dictionary...
I'm not sure what the best method is and how to go about implementing it.
What are your recomendations for this? I was able to do this easily in VB6,
but I'm not sure how to do it in .NET
1: I need to be able to use For Each Next... syntax
2: I need to be able to use either the Collection(Index as Integer) or
Collection(KeyName as String) methods to access an item.
3: I need to be able to strict types. Collection.Add(CollectionItem as
MyType)
4: Sorting is not needed. I will accomplish this in my SQL string.
4: Performance is an issue, but ease of use and functionality is a higher
priority.
Can anybody help explain what I need to do, and/or point me to some good
examples on the web where I can learn how to do it?
TIA,
-Matt