Search code examples
sqldatatypescalendarextender

How to set the Asp Calendar Extender DataType to smalldatetime


I have implemented a Calendar Extender for my website, I use this to search for dates in my database. The problem is I have all the dates in the database set to datatype smalldatetime and the dates from Calendar Extender is coming out as a type String. So I would like to know how to change the datatype for the date selected from Calendar Extender.

I'm a newbie so please help me out


Solution

  • Assuming that you're using ASP.NET and not classic ASP you can convert a string to datetime using the Convert or Parse method as shown here:

    http://msdn.microsoft.com/en-us/library/cc165448.aspx

    How are you pushing the data coming from your website to the database? Do you have some kind of data access layer?