E
E. Kwong
I just want to select records with a certain date field > today's date:
<asp:SqlDataSource ID="src1" runat="server" ConnectionString="<%$
ConnectionStrings:xyz %>"
SelectCommand="SELECT * FROM [Events] WHERE [Startdate] > ? "
OnSelected="src1_Selected">
<SelectParameters>
<asparameter Name="Startdate" Type="DateTime" />
</SelectParameters>
</asp:SqlDataSource>
---------------------
protected void srcEvents_Selected(object sender,
SqlDataSourceStatusEventArgs e)
{
e.Command.Parameters["Startdate"].Value = DateTime.Today;
}
-------------------
I have a list control bind to this data source but when executed the list
doesn't show. That means no record is selected. I know there are
qualifying records since I input them myself in SQL server.
Am newbie so I must code something wrong. Any insignt appreciated.
<asp:SqlDataSource ID="src1" runat="server" ConnectionString="<%$
ConnectionStrings:xyz %>"
SelectCommand="SELECT * FROM [Events] WHERE [Startdate] > ? "
OnSelected="src1_Selected">
<SelectParameters>
<asparameter Name="Startdate" Type="DateTime" />
</SelectParameters>
</asp:SqlDataSource>
---------------------
protected void srcEvents_Selected(object sender,
SqlDataSourceStatusEventArgs e)
{
e.Command.Parameters["Startdate"].Value = DateTime.Today;
}
-------------------
I have a list control bind to this data source but when executed the list
doesn't show. That means no record is selected. I know there are
qualifying records since I input them myself in SQL server.
Am newbie so I must code something wrong. Any insignt appreciated.