0

How do I populate Treeview with checkboxes with all the Databases and its tables in a Server using C# WPF Application?

 -Server 1----------------      
-        - Database1     -
-          -- Table1     -
-          -- Table2     -
-          -- Table3     -
-        - Database2     -
-          -- Table1     -
-          -- Table2     -
-          -- Table3     -
--------------------------
dksandimas
  • 13
  • 2
  • What do you have so far? Also, use [`SHOW DATABASES`](https://dev.mysql.com/doc/refman/5.1/en/show-databases.html) to retrieve the list of databases and [`SHOW TABLES`](https://dev.mysql.com/doc/refman/5.0/en/show-tables.html) to get the list of tables from the DB then it's just a [matter of adding them to the treeview](http://stackoverflow.com/q/30953599/162671) – Nasreddine Jul 10 '15 at 10:34

1 Answers1

0

You need to firstly return a list of all databases that are useful.

SELECT name FROM master..sysdatabases
WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb');

Then for each database get a list of tables

SELECT * FROM information_schema.tables

Then find examples of how to populate TreeViews in WPF.

maybe this one

Then ...... Write the code!

Community
  • 1
  • 1
DrLazer
  • 2,805
  • 3
  • 41
  • 52