Monday, December 6, 2010

DateTimePicker Format in C#

Here are Some Different Types of Format of  DateTimePicker

dateTimePicker2.Format = System.Windows.Forms.DateTimePickerFormat.Short;

dateTimePicker3.Format = System.Windows.Forms.DateTimePickerFormat.Time;

dateTimePicker4.CustomFormat = "yyyy-mm-dd";

dateTimePicker4.Format = System.Windows.Forms.DateTimePickerFormat.Custom;

Saturday, December 4, 2010

Select Record between Months in SQL

select ID, Name, Month from (
    select ID, Name, Month,
        case Month
            when 'January' then 1
            when 'February' then 2
            when 'March' then 3
            when 'April' then 4
            when 'May' then 5
            when 'June' then 6
            when 'July' then 7
            when 'August' then 8
            when 'September' then 9
            when 'October' then 10
            when 'November' then 11
            when 'December' then 12
        end as MonthNo
 ) as TempTable
    MonthNo between 1 and 12 order by [Month]

Wednesday, December 1, 2010

Convert String In Title Case C#

string s = "This is a test";
s = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(s.ToLower())

Convert ArrayList to String

ArrayList ar =new ArrayList();
string str=string.Empty;
str = String.Join(',', (string []) ar.ToArray(typeof(string)))


Visitor No

click for free hit counter
Download a free hit counter here.