Hi,
I have a C# web app written in .Net3.5. It consists of some webpages, a data layer and a business layer project.
To simplify my question I have a class "Car", this Car object has a corresponding Car SQL table and a related CarType table .
I have a view in the database which joins Car and CarType. In my Car class I have a method "GetCars" which calls the above view so that I can read the car type value rather than returning the Id - the problem is that I want to return a list of Car objects but am struggling to understand how to do it as my Car constructor doesn't cater for the join that I return in my stored proc.
E.G.
public List<Car> GetCars()
{
List<Car> cars= new List<Car>();
try
{
DataTable data = DataManager.ExecuteQuery("sp_GetCars");
foreach (DataRow row in data ...
Go to the complete details ...