Creating a Dataset from a Query
Posted on 2006-04-27
I'm trying to create a dataset with query that uses a dynamic field. Here is my sql:
SELECT a.cad_account_number, a.date_sold, a.county_name, a.sale_price,
(a.sale_price - b.txroll_NoticedLandValue)/b.txroll_GBA AS imp,
b.txroll_NeighborhoodCode, b.txroll_year, b.txroll_GBA, b.txroll_NoticedLandValue
FROM MLS a
INNER JOIN tbl_TaxRoll b
ON a.cad_account_number = b.txroll_CadAccountNumber
WHERE b.txroll_NeighborhoodCode IS NOT NULL AND b.txroll_GBA > 1 AND a.sale_price > 1
ORDER BY a.date_sold DESC, b.txroll_NeighborhoodCode
The second line creates a new field "imp" from calculations of other existing columns.
This sql works fine and I'm getting the needed results but I need to create a dataset that has all of these columns.
I'm using Visual Studio 2003 and MS SQL Server 2000. Is there any way of running this query and generating
a dataset from it? I just can't figure out how to use the visual studio IDE to generate a strongly typed dataset with multiple
tables that also has a dynamic column.
Any help is greatly appreciated.