public int RunConversion() { string[] hl7Files = Directory.GetFiles(inputFilePath); // List<string> list = new List<string>(); string line = string.Empty; foreach (string hl7 in hl7Files) { try { using (StreamReader sr = new StreamReader(hl7)) { DataRow dtRow = demoTable.NewRow(); //int count = 0; while (!sr.EndOfStream) { line = sr.ReadLine(); string[] lineData = line.Split('|'); for (int i = 0; i < lineData.Length - 1; i++) { demoTable.Rows.Add(dtRow);\\ when debug I dont see any values when I put a watch window for Rows. dtRow = demoTable.NewRow(); }//while }//using if (File.Exists(hl7)) { File.Copy(hl7, Path.Combine(archiveFilePath, Path.GetFileName(hl7) + ".Processed"), true); File.Delete(hl7); } } catch (Exception ex) { if (File.Exists(hl7)) { File.Copy(hl7, hl7 + ".Failed", true); File.Delete(hl7); } StringBuilder message = new StringBuilder(); message.Append("Error occurred in line = " + line + " when processing file " + hl7); message.Append("\nError Details:\n"); message.Append(ex.Message.ToString()); message.Append("\nNo Demographics File Generated!!!\n"); throw new Exception(message.ToString()); } } return 1; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)