Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8227849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:16:06+00:00 2026-06-07T16:16:06+00:00

I am trying to use AjaxToolKit CalendarExtender control with two textboxes in order to

  • 0

I am trying to use AjaxToolKit CalendarExtender control with two textboxes in order to develop search filter. The first TextBox is for the (startdate) and the second one will be for the finish date, and after clicking on the (Search) button, the results should be shown in a ListView with adding a checkbox at the first column of the ListView.

FYI, the database design is as following:

Employee Table: Username, Name...
SuggestionsLog: ID, Title, Description, DateSubmitted, StatusID
SuggestionsStatus: ID, Status

(DateSubmitted is a datetime datatype field)

The StartDate and EndDate will be based on the DateSubmitted column in SuggestionsLog table in the database. The problem is the format of the date selected from the Ajax CalendarExtender is as (July 2, 2012). Also, I wrote the query which is:

SELECT     dbo.SafetySuggestionsLog.Title, dbo.SafetySuggestionsLog.Description, dbo.SafetySuggestionsLog.Username, dbo.SafetySuggestionsLog.DateSubmitted, 
                      dbo.SafetySuggestionsStatus.Status
FROM         dbo.SafetySuggestionsLog INNER JOIN
                      dbo.SafetySuggestionsStatus ON dbo.SafetySuggestionsLog.StatusID = dbo.SafetySuggestionsStatus.ID
WHERE     (dbo.SafetySuggestionsLog.DateSubmitted = @startDate) AND (dbo.SafetySuggestionsLog.DateSubmitted = @finishDate)

I want to show the results in the ListView, however, nothing is displayed on the ListView and I don’t know why. Could you please help me with this?

ASP.NET:

<div>
                    <asp:Label ID="Label2" runat="server" Text="From: " />
                    <asp:TextBox ID="txtStartDate" runat="server" />
                    <asp:CalendarExtender ID="CalendarExtender1" runat="server" Enabled="True" 
                        Format="MMMM d, yyyy" TargetControlID="txtStartDate">
                    </asp:CalendarExtender>

                    <asp:Label ID="Label3" runat="server" Text="To: " />
                    <asp:TextBox ID="txtEndDate" runat="server" /> 
                    <asp:CalendarExtender ID="CalendarExtender2" runat="server" Enabled="True" 
                        Format="MMMM d, yyyy" TargetControlID="txtEndDate">
                    </asp:CalendarExtender>
                    <asp:Button ID="searchButton" runat="server" Text="Search" 
                        onclick="searchButton_Click" />

                    <asp:ListView ID="FilteredSuggestions" runat="server"></asp:ListView>
                </div>

Code-behind:

protected void searchButton_Click(object sender, EventArgs e)
    {
        string connString = ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString;
        SqlConnection conn = new SqlConnection(connString);
        string cmd = @"SELECT     dbo.SafetySuggestionsLog.Title, dbo.SafetySuggestionsLog.Description, dbo.SafetySuggestionsLog.Username, dbo.SafetySuggestionsLog.DateSubmitted, 
                                 dbo.SafetySuggestionsStatus.Status
                        FROM         dbo.SafetySuggestionsLog INNER JOIN
                                    dbo.SafetySuggestionsStatus ON dbo.SafetySuggestionsLog.StatusID = dbo.SafetySuggestionsStatus.ID
                        WHERE     (dbo.SafetySuggestionsLog.DateSubmitted = @startDate) AND (dbo.SafetySuggestionsLog.DateSubmitted = @finishDate)";

        SqlDataAdapter sda = new SqlDataAdapter(cmd,conn);
        sda.SelectCommand.Parameters.AddWithValue("@startDate", txtStartDate.Text);
        sda.SelectCommand.Parameters.AddWithValue("@finishDate", txtEndDate.Text);
        DataSet ds = new DataSet();
        sda.Fill(ds, "table");

        FilteredSuggestions.DataSource = ds.Tables["table"];
        FilteredSuggestions.DataBind();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:16:07+00:00Added an answer on June 7, 2026 at 4:16 pm

    Try this:

    Use BETWEEN to specify the date range

    SELECT     dbo.SafetySuggestionsLog.Title, dbo.SafetySuggestionsLog.Description, dbo.SafetySuggestionsLog.Username, dbo.SafetySuggestionsLog.DateSubmitted, 
                          dbo.SafetySuggestionsStatus.Status
    FROM         dbo.SafetySuggestionsLog INNER JOIN
                          dbo.SafetySuggestionsStatus ON dbo.SafetySuggestionsLog.StatusID = dbo.SafetySuggestionsStatus.ID
    WHERE     (dbo.SafetySuggestionsLog.DateSubmitted Between @startDate AND @finishDate)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the AjaxToolkit's ModalPopupExtender, but it doesn't work. In fact, as
I am trying use gem tire to search in my application. I have tables
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I get this error when trying to use the latest ajaxToolKit NET4. I've downloaded
I am trying use an if statement and TWO .addClass background-color variables based on
I am trying use std::copy to copy from two different iterator. But during course
I've been trying to use the AutoComplete Extender from the ASP.NET Ajax Control Toolkit,
I'm trying to use the rating control in the ajax toolkit. I'm currently setting
i'm trying use facebook API to upload photo in my fan page. I downloaded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.