I am fairly new to ASP.net and want some expert help on best practice code design; I am designing in Visual Studio in express. I am giving an example of a part of my system design and would appreciate some help on a few design concepts. I have two power metering database tables set up, tblMETER which holds meter information and tblPOWER which holds 15 minute power meter readings. In my ASP.net program I want to use classes and objects to reference the many power meters.
This is what I think I should do, create a class called PowerMeter, set properties for NUMBER, DESCRIPTION, and DIVIDER. Now when I create an instance of the class for example PM06 (power meter 06), Firstly what is the best way to assign the property values to the new instance, Like this?
DIM PM06 as new PowerMeter
PM06.Number = “06”
PM06.Description = read the database referencing meter number 06
PM06.Divider = read the database referencing meter number 06
Secondly I want to display the total P_KW readings for the meter on a web page.
Do I create another property for the class and assign it the value such as
PM06.Reading = return calculated reading or is there some way of using a method within the class?
Providing some good points on getting a working system using best practices.