Skip to content

Instantly share code, notes, and snippets.

@josephbales
Created September 15, 2015 23:01
Show Gist options
  • Save josephbales/b2f6d4b93113b6ae5ec5 to your computer and use it in GitHub Desktop.
Save josephbales/b2f6d4b93113b6ae5ec5 to your computer and use it in GitHub Desktop.
Code that gets malformed dates from a from an ObdcDataReader
while (reader.Read())
{
string line = "";
for (int i = 0; i < fCount; i++)
{
try
{
line = line + reader[i].ToString().Trim().Replace("\n", "").Replace("\r", " ") + "\t";
}
catch (Exception)
{
line = line + reader.GetString(i).Trim().Replace("\n", "").Replace("\r", " ") + "\t";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment