Login    
 
 
 
 
Text/HTML
  
You are here :: Blogs Saturday, May 19, 2012

Search
Note: This uses the internal blog search engine. The Google search engine is also available at the top of the page.
  
Disclaimer

Please review the site disclaimer before downloading or using content found on this site

  
Categories
  
DEVSHED Blog
As always, I welcome your comments!
Apr 16

Written by: Steve Gray
4/16/2010 11:08 AM  RssIcon

I recently upgraded a project to the ComponentArt 2009.1 calendar control, because I needed access to the time as well as the date, 2008 didn’t support that.

I have a complicated web form that looks at the parameters in a Crystal report and drops them on the form dynamically. For date params, I add the ComponentArt calendar control.

My code looked at the Request object and converted the value provided to a date. The 2009 control’s value is in the form of “2010.12.31.0.0.0” and that value won’t convert (easily) to a datetime object. Here’s my solution.

Code Snippet
  1. Imports System.Globalization

 

Code Snippet
  1. Dim dtDate As DateTime = DateTime.ParseExact(Request(strFieldName), "yyyy.M.d.h.m.s", CultureInfo.InvariantCulture)

This doesn’t look too hard… but it took about three hours to figure it out. You owe me.

Tags:
Categories:
As always, I welcome your comments!
  
 
 
Home | Products | Blogs | Contact Us | Links | God's Plan
Privacy Statement | Terms Of Use
 
Copyright 2011 by Devshed.us