Hey I would like to display certain data with my stored procedure for the last 30 days. here is what I have done (aspx.cs file):
protected void Page_Load(object sender, EventArgs e)
{
DateTime toDate, fromDate;
toDate = DateTime.Now;
fromDate = toDate.Subtract(new TimeSpan(31, 0, 0, 0));
SqlDataSource1.SelectParameters.Add("fromDate", DbType.DateTime, fromDate.ToString());
SqlDataSource1.SelectParameters.Add("toDate", DbType.DateTime, toDate.ToString());
}
here is my aspx file
<form id="form1" runat="server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" Width="232px" DataKeyNames="CustomerId" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="CreationDate" HeaderText="CreationDate" SortExpression="CreationDate" />
</Columns>
</asp:GridView>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SSEnewConnectionString %>"
SelectCommand="procCustomer_SelectbyCreationDate" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter DbType="DateTime" Name="fromDate" />
<asp:Parameter DbType="DateTime" Name="toDate" />
</SelectParameters>
</asp:SqlDataSource>
</form>
when I test this my screen comes up blank (other than the masterpage elements) and no errors. any ideas?