Im using c# .net windows form application. i have a SQL database with 5 tables. i need to populate a combobox with these table names. only names should be displayed.
Asked
Active
Viewed 962 times
2 Answers
1
Can't know for sure until you specify what you're using, but this is a more or less standard query for retrieving the table names (excluding views) in the current database:
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'

Matti Virkkunen
- 63,558
- 9
- 127
- 159