Skip to content

Instantly share code, notes, and snippets.

@jgauffin
Created October 18, 2012 12:33
Show Gist options
  • Select an option

  • Save jgauffin/3911506 to your computer and use it in GitHub Desktop.

Select an option

Save jgauffin/3911506 to your computer and use it in GitHub Desktop.
Code of the day
private void CheckForError(DataRow dr, string procedurnamn)
{
string fel_text = null;
try {
if (!string.IsNullOrEmpty(dr["FELTEXT"]) | dr["SQLCODE"] != 0) {
fel_text = "Procedur " + procedurnamn;
fel_text += Constants.vbCrLf + "PGM " + dr["PGM"];
fel_text += Constants.vbCrLf + "SEKTION " + dr["SEKTION"];
fel_text += Constants.vbCrLf + "TABELL " + dr["TABELL"];
fel_text += Constants.vbCrLf + "SQLKOD " + dr["SQLCODE"];
fel_text += Constants.vbCrLf + "FELTEXT " + dr["FELTEXT"];
throw new Exception(fel_text);
}
} catch (Exception ex) {
throw;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment