<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>
Asked
Active
Viewed 447 times
0

zey
- 5,939
- 14
- 56
- 110
-
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 Answers
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
- 83
- 3
- 21
-
-
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