How do I get a date from an object and add it to a warning message?

okaymy1112

Member
Joined
Aug 26, 2014
Messages
6
Programming Experience
Beginner
I have an object that contains a date from database table.
I would like to use the date from the object to add the following warning message to a page Date cannot be before 12/15/2018
Here is the object that have date 12/15/2018

VB.NET:
DateTime MyMeetingEarliestDate = HY.Common.HYConfigurationHelper.GetDateFromHYConfiguration("MeetingEarliestDate");

Right now I have manually put the warning message manually on MeetingTrackingFilter.aspx page.

JavaScript:
<telerik:RadAjaxPanel ID="FilterElementsRAP" runat="server">

    <div style="padding: 2px;">

        <div style="float: left; width: 20px;">

            <asp:CheckBox ID="MeetingDateChk" runat="server" ValidationGroup="FilterGroup" Checked="false" AutoPostBack="true" OnCheckedChanged="MeetingDateChk_CheckedChanged" />

        </div>

        <div style="float: left; width: 220px;">

            <asp:Label ID="MeetingDateLabel" runat="server" AssociatedControlID="MeetingDateChk" Text="Event Date"></asp:Label>

        </div>

        <div style="float: left; width: 120px;">

            <asp:DropDownList ID="MeetingDateDDL" runat="server" Width="100px" AutoPostBack="true" OnSelectedIndexChanged="MeetingDateDDL_SelectedIndexChanged">

                <asp:ListItem Text="Equals" Value="Equals" Selected="False"></asp:ListItem>

                <asp:ListItem Text="Between" Value="Between" Selected="False"></asp:ListItem>

            </asp:DropDownList>

        </div>

        <div style="float: left; width: 375px;">

            <span style="display: inline-block !important;">

                <telerik:RadDatePicker runat="server" RenderMode="Lightweight" ID="MeetingDateRDP1" AutoPostBack="True" OnSelectedDateChanged="MeetingDateRDP1_SelectedDateChanged">

                    <Calendar runat="server" ShowRowHeaders="false"></Calendar>

                </telerik:RadDatePicker>

            </span>

            <span style="display: inline-block !important;">

                <asp:Label ID="MeetingDateBetweenLabel" runat="server">&nbsp;And&nbsp;</asp:Label></span>

            <span style="display: inline-block !important;">

                <telerik:RadDatePicker runat="server" RenderMode="Lightweight" ID="MeetingDateRDP2" AutoPostBack="True" OnSelectedDateChanged="MeetingDateRDP2_SelectedDateChanged">

                    <Calendar runat="server" ShowRowHeaders="false"></Calendar>

                </telerik:RadDatePicker>

            </span>

            <span style="font-size: small">Date cannot be before 12/15/2018</span>

        </div>

    </div>

</telerik:RadAjaxPanel>

Please help.
 
Well you left out a ton of information which is needed to give you an accurate answer. Like what database engine you are using, and which type of server they are on, local or remote, and how you are connecting to said server already....

Well, since you only want to get a date object from the database, I would use SqlCommand.ExecuteScalar Method (System.Data.SqlClient) with a select statement. I assume you know how to write them....
 
Back
Top