Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. using System.Data.Sql;
  2. class Program
  3. {
  4. static void Main()
  5.  
  6.  
  7. {
  8. SqlDataSourceEnumerator instance =
  9. SqlDataSourceEnumerator.Instance;
  10. System.Data.DataTable table = instance.GetDataSources();
  11. DisplayData(table);
  12. }
  13. private static void DisplayData(System.Data.DataTable table)
  14. {
  15. foreach (System.Data.DataRow row in table.Rows)
  16. {
  17. foreach (System.Data.DataColumn col in table.Columns)
  18. {
  19. Console.WriteLine("{0} = {1}", col.ColumnName, row[col]);
  20. }
  21. Console.WriteLine("=============");
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement