Link to home
Start Free TrialLog in
Avatar of Peter Kiers
Peter KiersFlag for Netherlands

asked on

How to get the CultureInfo of the pc and convert de DayOfWeek string

Hi,

Here is a part of my methode. The colde-line that I have marked with an arrow
is the code that I can not convert to the currentculture of the pc.


        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            XmlNodeList LoopNodes;
            DateTime DT1;
            DateTime TM1;
            string VAL;
            try
            {
                XmlDocument doc = new XmlDocument();
                doc.Load("XML//G503123.XML");
                LoopNodes = doc.GetElementsByTagName("BG");
                gridView1.BeginUpdate();
                BindingSource currentBindingSource = grdGlucs.DataSource as BindingSource;
                DataView dataViewList = currentBindingSource.List as DataView;
                dataViewList.Table.Rows.Clear();
                foreach (XmlNode node in LoopNodes)
                {
                    DT1 = DateTime.Parse(node.Attributes["Dt"].Value);
                    TM1 = DateTime.Parse(node.Attributes["Tm"].Value);
                    VAL = node.Attributes["Val"].Value;

                    DataRowView newDataRow = (currentBindingSource.AddNew() as DataRowView);
                    newDataRow["Day"] = DT1.DayOfWeek.ToString();  <==============
                    newDataRow["Date"] = DT1.Date.ToString("d");
                    newDataRow["Time"] = TM1.ToString("t");
                    newDataRow["Value"] = VAL; 
                    try

Open in new window


Who can help me?

Peter
Avatar of Alfredo Luis Torres Serrano
Alfredo Luis Torres Serrano
Flag of United States of America image

Is this a WinForms or ASP.NET application.
Avatar of Peter Kiers

ASKER

I use Microsoft Visual Studio 2010 and I programm in C#.

Can someone please help me, and not just sending url's.

Peter
Certainly, but you haven't answered my question  = )
Sorry for a late response:

Its WinForms application.

Peter
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
cactus_data you gave me the righ solution. 500 p's are comming to you.

Greetings,

Peter Kiers
Thanks. You are welcome!

/gustav