|
-
Oct 5th, 2010, 02:05 PM
#1
[RESOLVED] C# ParseExact
Can you get the if condition in a single line of code?
oa is a dataset.
ACQ_DATE is a column and it could be null.
Code:
if (oa["ACQ_DATE"].ToString() == "")
{
PurchaseDt = DateTime.Now;
}
else
{
PurchaseDt = DateTime.ParseExact(oa["ACQ_DATE"].ToString(),"d",provider);
}
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Oct 6th, 2010, 03:57 AM
#2
Re: C# ParseExact
purpose? have you considered wrapping into a function?
-
Oct 6th, 2010, 04:19 AM
#3
Re: C# ParseExact
What is your VS version. what is oa ?. Have you considered using Extensions methods ?
Please mark you thread resolved using the Thread Tools as shown
-
Oct 6th, 2010, 09:43 AM
#4
Re: C# ParseExact
 Originally Posted by leinad31
purpose? have you considered wrapping into a function?
Wrapping into a function will be my last resort.
 Originally Posted by danasegarane
What is your VS version. what is oa ?. Have you considered using Extensions methods ?
VS 2010. OA is an OracleDataReader object. What do you mean by extensions methods?
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Oct 6th, 2010, 10:01 AM
#5
Re: C# ParseExact
Refer Extension methods in MSDN
Please mark you thread resolved using the Thread Tools as shown
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|