my query is
String query = @"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';";
this will return all the table names of database in combobox.
but i want fix number of tables in combobox which changes is require in this query?
please help
thank you..
Loading

Joginder BangerRank #360 · 7K reputationPosted Feb 2, 2015, 8:38 PM EST
Asmita Patil,
Like means works similar. For example
String query = @"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE like '%' +'BASE TABLE' +'%' . This query return multiple records.
Note:- if you want data only start Base table name just change something in query like
Table_type like 'Base table +'%'
Or if you want data end with base table change something like this Table_type '%'+'base table'
Riddhi ValechaRank #794 · 2.9K reputationPosted Jan 31, 2015, 12:38 AM EST
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
This will give total number of tables.
VulpesRank #55 · 29.2K reputationPosted Jan 31, 2015, 9:20 AM EST
Which tables in particular do you want the query to return? If they have a similar name you might be able to use a LIKE operator in the WHERE clause.
Saber ShaikhRank #1,687 · 905 reputationPosted Feb 2, 2015, 9:39 PM EST
Hi Asmita,
(Joginder Banger) Right
String query = @"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE like '%' +'BASE TABLE' +'%'
it is Right
asmita patil19 reputationPosted Jan 31, 2015, 12:47 AM EST
thank you for your reply,
can u please explain count(*) means?
i want perticular tables in combo box where and how to specify that table name in query.
asmita patil19 reputationPosted Feb 2, 2015, 8:23 PM EST
thank you for your reply..
your suggestion will be work but one problem is there...
in LIKE operator multiple tables name can not be allow
so how to write multiple tables name in LIKE operator..
please help..
asmita patil19 reputationPosted Feb 2, 2015, 11:11 PM EST
its done now....