Microsoft
Software
Hardware
Network
Question : how can I override the DateTime class to add a custom method??
Hi, I want to override the default class System.DateTime to add a custom method, now i'm doing it this way (but doesn't works):
partial class DateTime
{
public string ToStringFormated()
{
return base.ToString(AppConfig.da
teFormat);
}
}
i''m getting a incoherence accessibility error.
Answer : how can I override the DateTime class to add a custom method??
DateTime is a class, you cannot derive a new class to override it.
The unique way is to use an extension method, but you require C# 3.0 for this (VS 2008), but still can use .net 2.0
Is that your case?
Random Solutions
Exchnage Activesync and Android 2.0 Calendar Syncing issue
Reversing cross tab
How define combo box control source for multiple fields?
Exchange 2010 first time setup - can not send or receive email outlook 2003 outlook 2007
I have a 500 gb sata HDD that when i connect it to my laptop via USB get this error.
Create Database for freeform answers
SQL Synax to combine data in two views
Good Beginner to Advanced Tutorial for XAML
How can I customize the windows password complexity error message that pops up after changing your password in Active Directory?
dsquery / dsget - different results, not able to pass results to dsget