hi all,,,
well i am using asp.net 2005 and sql server 2005...
i hav a database called as ABC,,i am using a gridview and a dropdown list inmy application.
What i want is ,,the dropdown list should be populated wiyh all the table names available in ABC database and on the click of a submit button it the attributes of that table should be displayed in tht grid view.....
can ne1 help me out in solving ths prob,,,ASAP,,
thnks in advance

THe first part is easy.
You can get all the tables from the database through this query:

SELECT * FROM sysobjects WHERE type = 'U'

Just populate the dropdown with the output from this query.

On selection of the dropdown, get all columns and display them in the grid.

This query will help you in this

select column_name from information_schema.columns
 where table_name = '<table name>'
order by ordinal_position

Hope this helps!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.