Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. public DataSet getData(List<NpgsqlCommand> cmds, int timeout)
  2. {
  3. try
  4. {
  5. DataSet toReturn = new DataSet();
  6. if (staticTables != null && cmds.Count > 0)
  7. {
  8. var con = getNewConnection();
  9.  
  10. cmds.ForEach(cmd =>
  11. {
  12. cmd.Connection = con;
  13. NpgsqlDataAdapter adapter = new NpgsqlDataAdapter(cmd);
  14. adapter.Fill(toReturn);
  15. });
  16. }
  17. return toReturn;
  18. }
  19. catch (Exception e)
  20. {
  21. log.Warn(e, "Failed to load tables from given list of strings.");
  22. return null;
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement