I have a table in Access database / SQL server named Employee , Which has the following columns
EmpId | Name | TempAddress | PerAddress | OffAddress
123 Harry India Odisha Tamilnadu
124 Harry India Haryana Banglore
125 Harry USA LA LA-2nd street
In the above table 3 persons having name Harry those who are staying in 3 different places . What i want is to do some mechanism and make Employee table as class representation , so that the following scenario can be possible . I don't want to write some more code for it from my side , like taking all that things to recordset ,then do the parsing and make a class with the data being present inside recordset .
What i want is mentioned below ::
Employee emp = new Employee[3]
Console.writeline (emp[1].EmpId.Name.OffAddress);\\ output - Tamilnadu
Console.writeline (emp[2].EmpId.Name.OffAddress);\\ output - Banglore
Console.writeline (emp[3].EmpId.Name.OffAddress);\\ output - LA-2nd street
Is the above mechanism possible through .Net (VS 2008/2010 ). Please give me the way to do if some mechanism exist on it .
Thanks in advance ..