troubleshooting Question

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

Avatar of Peter Kiers
Peter KiersFlag for Netherlands asked on
.NET ProgrammingC#
8 Comments1 Solution402 ViewsLast Modified:
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

Who can help me?

Peter
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros