.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Code Snippets >> DateTime >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Split date field and Fill in comboboxes in C#.net

Posted By:Narayanan       Posted Date: February 22, 2012    Points: 40    Category: DateTime    URL: http://www.dotnetspark.com  

Here, This code is split a date Time field and fill in the ComboBoxes in the C#.Net

  dte = DateTime.Today;
            string str = Convert.ToString(dte);
            string [] sr = str.Split(' ' );
            string fvalue = sr[0];
            string[] splitdate = fvalue.Split ('/');
            string mnt = splitdate[0];
            string day = splitdate[1];
            string year = splitdate[2];

            comboBox1.Text = day;
            comboBox2.Text = mnt;
            comboBox3.Text = year;


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend