|
As another guy in this thread said, if you are just doing small "one-off" apps, MVVM definitely isn't worth the trouble. Actually, let me rephrase that: *PROPER* MVVM isn't worth the trouble for small "one-off" apps. Lots of guys say they are doing MVVM, but when you look at their code, its more like "make believe MVVM" since they've broken a lot of MVVM tennants. I'm not sure where you fall in that category (no offense intended), but if you aren't doing MVVM right, or are just doing it because "its what the cool kids are doing", you are asking for trouble and hair pulling. You should only use MVVM where its appropriate and understand why you are using it. If your MVVM infrastructure is larger then your app "u r doing it wrong!!" .
I'm even going to go a step further... for small "one-off" apps, why even bother with WPF? WPF is intended for rich customized applications. If you are just doing a cookie cutter form with stock controls, WPF ain't worth the hassle. Lots of stupid small things that would take you one line of code in Winforms would take pages and pages of code in WPF. WPF is a huge time saver in certain areas, but its also a massive time killer in other areas.
As for WPF vs. Silverlight... its straight forward to go from Silverlight to WPF since Silverlight is a subset of WPF. Not so easy to go the other way.
|
|
|
|
|
How to change date format in c#
i need dd/mm/yy
i am using Vs 2008 And SQL Server 2005
Please Help Me
thanks in advance
|
|
|
|
|
You'll be pleased to know that there are several handy formatters available for dates. This one could be achieved using something like:
Console.WriteLine("Date is {0}", DateTime.Now.ToString("dd/MM/yy")); Why do you need to change the date format though? It's generally better to leave the date formats as the user expects them to be set up based on their locale settings. Changing them round may lead to unfortunate consequences for the user if they misread the date because of differences in the format.
|
|
|
|
|
i need to insert date in Sql Server 2005 as DD/MM/yy
how i can do this??
please Tell Me
Thanks In Advance
|
|
|
|
|
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.
|
|
|
|