Listing all the Tables of Current database


This blog lists all the table available in the current database taking the help of system table. to list the tables of database i have taken the help of, using you cant list the current database table. see the bellow code for more details

     SqlConnection connection=new SqlConnection("ConnectionString");
            SqlCommand command = new SqlCommand("select name as TableName,create_date from sys.tables",connection);
            SqlDataAdapter adapter = new SqlDataAdapter(command);
            DataTable dataTable=new DataTable();


Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now