0
<asp:DropDownList ID="DropDownList1" runat="server" CssClass="account-content">
            <option value="" onclick="tbl_city"> All</option>
            <option value="">City</option>
            <option value="">State</option>
            <option value="">Country</option>
            <option value="">Project</option>
            <option value="">Project Detail</option>
            <option value="">Project Category</option>
            <option value="">User</option>
            <option value="">User Detail</option>
            </asp:DropDownList>
zey
  • 5,612
  • 14
  • 50
  • 99
  • which version of mssql are you using ? can you give more detailed requirement ? Use following link for the SQL and then load your dropdown with the results of the SQL: http://stackoverflow.com/questions/175415/how-do-i-get-list-of-all-tables-in-a-database-using-tsql – rags Jul 17 '13 at 08:51
  • i using sql server 2005 – Hetal Bodar Jul 17 '13 at 08:59
  • ok i fetch the tabels but how to bind tabels name in dropdown – Hetal Bodar Jul 17 '13 at 09:00

1 Answers1

0

Use Entity Framework. Bind data to the gridview and use SelectedIndexChanged property of DropDownList to Redirect to that page . you can use something like this:

        private DataEntities dataContext;
          dataContext = new DataEntities1();
         gv.DataSource = dataContext.objectName.ToList<TEntity>();
         gv.DataBind();
waris kantroo
  • 85
  • 3
  • 18
  • i want to display table name in dropdown list dynamically – Hetal Bodar Jul 17 '13 at 09:41
  • Check the below link for the solution. I hope it helps: http://www.daniweb.com/software-development/csharp/threads/420721/how-to-get-database-tables-names-into-dropdown-list-box – waris kantroo Jul 17 '13 at 10:04