TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pragadheesh
NA
6
0
How to use CodeObjectCreateExpression for System.DateTime in C# codeDom
Apr 22 2009 8:25 AM
Here i the method 'BOOL()' returns a Boolean value. Now i need to do similar thing of returning a DateTime value. When i used,
new CodePrimitiveExpression(DATETIME());
where 'DATETIME()' returns a DateTime value. But i got the below exception when i tried CodePrimitiveExpression,
Invalid Primitive Type: System.DateTime. Consider using CodeObjectCreateExpression.
So how can i use CodeObjectExpression to get a DateTime value.?
Here is the code snippet attached.
if (p.ParameterType == typeof(System.Boolean))
return new CodeVariableDeclarationStatement(p.ParameterType, options.sVariableNamePrix + p.Name,
new CodePrimitiveExpression(BOOL()));
else if (p.ParameterType == typeof(System.DateTime))
return new CodeVariableDeclarationStatement(p.ParameterType, options.sVariableNamePrix + p.Name,
// new CodeObjectCreateExpression(DATETIME()));
Reply
Answers (
0
)
simple conversion
Threads inside threads = Memory Leak