none
How to provide DateTime.Today( ) to a stored procedure via the data source config wizard of a dropDownList RRS feed

  • Question

  • Hi, I have a dropdownlist on my Default.aspx. I'm using VS2017

    I have added the dropdown to the page and selected an SQL data source then the connection, I specified a custom SQL statement or stored procedure then chose the procedure I created in SQL Server. When I created the SP I used @Date parameter which I now need to pass in order to populate the dropdown with the list the SP returns.

    How do I pass DateTime.Today() or DateTime.Now() in the define parameters part of the wizard?


    CuriousCoder

    Wednesday, August 15, 2018 11:40 AM

Answers

  • I did it not using the GUI but with the code behind if anyone needs it as described in the following link:

    http://aspalliance.com/618_CodeSnip_Populate_a_DropDownList_with_a_Stored_Procedure


    CuriousCoder

    • Marked as answer by CuriousCoder15 Wednesday, August 15, 2018 12:26 PM
    Wednesday, August 15, 2018 12:26 PM

All replies

  • Hello,

     

     Below are some articles link of the same nature of your post. No particular

    relative order.  However,  the 1st link may be more useful.

     

     https://www.sqlservercentral.com/Forums/Topic1624185-3077-1.aspx

     

     http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=159448

     

     https://stackoverflow.com/questions/15458263/stored-procedure-with-date-parameters


     

     Hope this helps :)

    Wednesday, August 15, 2018 12:17 PM
  • I did it not using the GUI but with the code behind if anyone needs it as described in the following link:

    http://aspalliance.com/618_CodeSnip_Populate_a_DropDownList_with_a_Stored_Procedure


    CuriousCoder

    • Marked as answer by CuriousCoder15 Wednesday, August 15, 2018 12:26 PM
    Wednesday, August 15, 2018 12:26 PM