|
a database should store data using the most appropriate type; string is not the most appropriate type for datetimes, as it is subject to lots of confusion. Use an actual date or datetime field.
BTW: you may be interested in reading this little article[^].
|
|
|
|
|
Another Luc-ticle strikes again
return 5;
|
|
|
|
|
There must be a reason why I turned my answers to popular questions into little articles...
|
|
|
|
|
Because you know too much to fit into a reasonably sized forum post?
return 5;
|
|
|
|
|
I also don't like typing the same things over and over too much.
|
|
|
|
|
Unless you're using parameters to squirt the data into the database (as you should be doing), converting it to a string is necessary...and MS SQL expects a certain format (one of which is the one shown by the OP).
|
|
|
|
|
is that any different from what my article says?
|
|
|
|
|
Don't know. Didn't read it. Just responded to the post, not the btw.
OK. Just skimmed the article. Nope.
Still, the OP just as likely did what I did, looked at the post itself which essentially said to redesign the database if it wasn't using datetimes.
|
|
|
|
|
You should never store the data in a format such as this. Store it in a locale agnostic fashion, and let the front end format the string to the relevant format using a method such as ToShortDateString() on a DateTime .
|
|
|
|
|
You do that only when you output it, generally with ToString ( "format" ) , or you could set the format of your system to do it -- I set mine to use an ISO 8601 format.
|
|
|
|
|
Declaring
bool? b = true;
Then,
b.GetType();
should return Nullable or Null?
Why does it has type bool?
I am not clear on this. Your know' will be helpful.
|
|
|
|
|
From http://msdn.microsoft.com/en-us/library/ms366789%28VS.80%29.aspx[^]:
However, if you attempt to obtain type information from Nullable variables at runtime using the GetType method or the is operator, the result is a Type object that represents the underlying type, not the Nullable type itself.
Calling GetType on a Nullable type causes a boxing operation to be performed when the type is implicitly converted to Object. Therefore GetType always returns a Type object that represents the underlying type, not the Nullable type.
|
|
|
|
|
Excellent answer. Clear, concise and accurate - just the kind I like.
|
|
|
|
|
Good Reply. Thank You
|
|
|
|
|
|
RaviSant wrote: b.GetType();
It will return underlying datatype only.
RaviSant wrote: should return Nullable or Null?
No. It's just prone to accept null values that's it.
|
|
|
|
|
RaviSant wrote: Declaring
bool? b = true;
The intention of nullable types is to allow/accept null value. So when we declare "bool?" then, it is of type "Boolean" and can accept null value.
You can check if the variable has the value by using "HasValue" property of variable. if it is true then get the value of variable using "Value" property.
Knock out 't' from can't, you can if you think you can.
|
|
|
|
|
Dear Skilties...
I am doing a project on "SECURE E-COMMERCE" so I need to validate the Credit Cards. Kindly anyone send the code to me.
srinivas96alluri@ymail.com
|
|
|
|
|
Can I have half your profits?
|
|
|
|
|
You've done all the work, it will only be fair that you get all of them.
|
|
|
|
|
Nah, I assume Shrinvas will be supplying the card numbers...He should get some of the profit for that bit. Oh, and all the risk-of-arrest.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
1) Don't post your email to any public forum, unless you really like spam.
2) Don't ask for codez, unless you really want to annoy people.
3) Try googling: many web hosting companies are out there, most of which will be more than happy to help you validate credit cards as part of a ecommerce site. Otherwise, they may assume you are trying to rip people off.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
OriginalGriff wrote: trying to rip people off
I don't think he is going to be very successful at this somehow.
|
|
|
|
|
It's so refreshing to see disorganised crime in the "planning" stages, isn't it?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
I want to know what skilties are. Google Translate tells me that it's Lithuanian for column, but I really doubt that's what he means.
|
|
|
|