|
Why have you posted this with a link to your QA post? Please post questions in one forum only.
|
|
|
|
|
sorry for that, plz help me.
|
|
|
|
|
|
You can't set a DateTime to null.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
|
That's not what I would call a reasonable practice. I prefer my DateTimes to be valid in some way (and use new DateTime(0) to accomplish that).
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
John Simmons / outlaw programmer wrote:
That's not what I would call a reasonable practice. |
It is a possible and valid scenario, whether you John, agree with it or not. Just saying...
For instance, shipping dates - they are usually null until something actually ships.
|
|
|
|
|
We can argue the validity of nulls all day. I don't like 'em, and I strive to resolve them in some way.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
One would use a "shipped event", in that case.
One could drop and smash the shipment .... One does not carry a null "damaged date" in anticipation.
|
|
|
|
|
I don't think you would set a DateTime to string.empty .
|
|
|
|
|
Of course you can't. But I don't know how they are working with the actual data and displaying it. I am starting to regret posting an answer to his question.
|
|
|
|
|
Slacker007 wrote: I am starting to regret posting an answer to his question.
Waaa-waaaa-waaaaaaaaaaa.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
You know John, you don't "always" have to be an a**hole.
|
|
|
|
|
Yes. Yes, I do. If I wasn't always an assh*le, I would disappoint my legions of fans. Besides, me being an assh*le is really the only constant in life any more that absolutely EVERYBODY can count on.
Beyond that, I was just poking you in the ribs. If you're honestly butt-hurt, I can call a waaa-mbulance for you.
BTW, I'm the one that voted your original answer a 5.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
|
Why are you yelling at me?
|
|
|
|
|
Read the whole thread - the answer is there.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Actually (to build on Slacker's answer), the return value of the TryParse method is either true or false, and if true, the specified out parameter contains the parsed DateTime value. If the return value is false, the specified string was not in a recognizable DateTime string format.
Additionally, if you know for sure what the format of the string will be, you can use ParseExact .
For details about using either of these methods, google is, once again, your friend.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Thanks, I corrected my post.
Funny, I use this all the time, yet I posted its implementation incorrectly.
|
|
|
|
|
I am using dgv printer to print datagridview and wold like to know how to close the printing box if an exceptions is encountered.
|
|
|
|
|
|
datagridview printer, I downloaded it from this website and I am using the dll version because I am programing in vb.net using visual studio community 2015.
Sorry for that.
|
|
|
|
|
So it's from an article then? You should really ask your question in the forum at the end of the article. It's extremely unlikely that the author of that piece will just happen to wander through the C# forum and realise that you have a question for her or him.
This space for rent
|
|
|
|
|
|
I need .net solution (c# preferred) for this. I need to read data from USB flash drive, not by normal file reading way, but byte by byte using its memory address. I used winusbnet library. But
USBDevice device = GetSingleDevice(myguid)
always return null. I have checked guid resides in registry. Also I confirmed the guid in device manager too. But I can't figure out what went wrong.
|
|
|
|