Click here to Skip to main content
15,894,646 members
Home / Discussions / C#
   

C#

 
AnswerRe: Read XML Data from C# Pin
tom57200726-May-09 22:35
tom57200726-May-09 22:35 
Questionreading text file and calculating the working hours for each employee Pin
emmy_23200326-May-09 22:14
emmy_23200326-May-09 22:14 
QuestionRe: reading text file and calculating the working hours for each employee Pin
Rajesh R Subramanian26-May-09 22:22
professionalRajesh R Subramanian26-May-09 22:22 
AnswerRe: reading text file and calculating the working hours for each employee Pin
emmy_23200326-May-09 22:25
emmy_23200326-May-09 22:25 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff26-May-09 22:36
mveOriginalGriff26-May-09 22:36 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200326-May-09 22:47
emmy_23200326-May-09 22:47 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff26-May-09 23:02
mveOriginalGriff26-May-09 23:02 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200327-May-09 0:16
emmy_23200327-May-09 0:16 
you are right
i made this
string[] allLines = System.IO.File.ReadAllLines(@"C:\new.txt");
                              for (int m = 0; m < allLines.Length; m++)
                              {
                                    string eachRow = allLines[m].ToString();
                                    string[] rowaArray = eachRow.Split(',');

                                    string enrollID = rowaArray[1].ToString();
                                    date1 = DateTime.Now;

                                   
                                 //   DateTime time1 = System.Convert.ToDateTime(rowaArray[5].ToString());
                                    date2 = System.Convert.ToDateTime(rowaArray[3].ToString());
                                    // DateTime time2 = System.Convert.ToDateTime(rowaArray[5].ToString());
                                
                                    rowaArray[3].ToString(); // Date
                                    // rowaArray[5].ToString(); // Time
                                 //   string Datez = rowaArray[3].ToString() + " " + rowaArray[5].ToString();

                                    TimeSpan ts = new TimeSpan();
                                 // ts = time2.Subtract(time1);

                                    ts = date2.Subtract(date1);
                                    listBox1.Items.Add(ts.Days + " Days " + ts.Hours + " Hours " + ts.Seconds + " Seconds ");  
                              }
but still can't have output as when i add this code
string Datez = rowaArray[3].ToString() + " " + rowaArray[5].ToString();

tells me that Index was outside the bounds of the array.
when i highlight it i have this as o/p
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-27 Days -12 Hours -55 Seconds
-26 Days -12 Hours -55 Seconds
-26 Days -12 Hours -55 Seconds
-26 Days -12 Hours -55 Seconds
-26 Days -12 Hours -55 Seconds
i think it's wrong right
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 0:48
mveOriginalGriff27-May-09 0:48 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200327-May-09 1:22
emmy_23200327-May-09 1:22 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 1:28
mveOriginalGriff27-May-09 1:28 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200327-May-09 1:36
emmy_23200327-May-09 1:36 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 1:54
mveOriginalGriff27-May-09 1:54 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 1:55
mveOriginalGriff27-May-09 1:55 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 4:29
mveOriginalGriff27-May-09 4:29 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200327-May-09 20:58
emmy_23200327-May-09 20:58 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 22:08
mveOriginalGriff27-May-09 22:08 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200328-May-09 1:11
emmy_23200328-May-09 1:11 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff28-May-09 1:24
mveOriginalGriff28-May-09 1:24 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200328-May-09 1:28
emmy_23200328-May-09 1:28 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff28-May-09 1:59
mveOriginalGriff28-May-09 1:59 
GeneralRe: reading text file and calculating the working hours for each employee Pin
emmy_23200329-May-09 23:02
emmy_23200329-May-09 23:02 
GeneralRe: reading text file and calculating the working hours for each employee Pin
Henry Minute27-May-09 0:39
Henry Minute27-May-09 0:39 
GeneralRe: reading text file and calculating the working hours for each employee Pin
OriginalGriff27-May-09 0:45
mveOriginalGriff27-May-09 0:45 
QuestionViewer Pin
ellllllllie26-May-09 22:07
ellllllllie26-May-09 22:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.