newbie to asp.net here.
I am trying to setup a selectparameters and controlparameters based off textbox web controls for date ranges to retrieve data on a asp.net page.
SelectCommand="SELECT SUM(Turnover) AS TotalTurnover, (SUM(Turnover) / (SELECT COUNT(*) FROM (SELECT DISTINCT [Trade Date] FROM TradeSummary WHERE ([Trade Date] BETWEEN @T1 AND @T2)))) AS AverageTO FROM TradeSummary WHERE ([Trade Date] BETWEEN @T1 AND @T2)"> <SelectParameters> <asp:ControlParameter ControlID="TradeDate1" DefaultValue="8-10-2012" Name="T1" Type="DateTime" PropertyName="Text" /> <asp:ControlParameter ControlID="TradeDate2" DefaultValue="8-11-2012" Name="T2" Type="DateTime" PropertyName="Text" /> </SelectParameters>
TradeDate1 and TradeDate2 refer to 2 textbox controls that I setup for date picking.
I am wondering how I can examine the values of @T1 and @T2 so that I can ensure the query being passed to the DB is valid because it seems like if I were to eval("TotalTurnover") then I get a dbnull error.
Any help would be appreciated. Thanks!