Skip to content

CSV file synchronized with DataTable changes... #2124

Discussion options

You must be logged in to vote

There were a few cases where some files were still being corrupted. I have updated the StreamReader with an explicit encoding declaration.

        static readonly Encoding enc = Encoding.Default;
        static readonly CultureInfo culture = CultureInfo.CurrentCulture;

        public static void UpdateCSV_RowChanged(object sender, DataRowChangeEventArgs e, FileInfo oFile)
        {
            if ((e.Action == DataRowAction.Change) || (e.Row.RowState == DataRowState.Added))
            {
                DataTable dt = (DataTable)sender;
                int iRowIndex = dt.Rows.IndexOf(e.Row);
                StringBuilder sb = new StringBuilder();
                CsvConfiguration config =…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by vasagle-gleblu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant