I add dropdown list in the form, connect with gridviev1 from table1. it is not problem to show one in the gridview. But I have 4 tables. I have 4 values in the drop down list. Is this posible to relise by LinqDataSource? Can anyone sugest me how could I
do this?
zemzela
Member
20 Points
41 Posts
select value in the dropdownlist and show different tables
Jun 01, 2012 09:59 PM|LINK
I add dropdown list in the form, connect with gridviev1 from table1. it is not problem to show one in the gridview. But I have 4 tables. I have 4 values in the drop down list. Is this posible to relise by LinqDataSource? Can anyone sugest me how could I do this?
1 when check value 1 show table1
2 when check value 2 show table2
3 when check value 3 show table3
4 when check value 4 show table4
Where I could find the code? tnx
MahadTECH
Star
8978 Points
1660 Posts
Re: select value in the dropdownlist and show different tables
Jun 01, 2012 11:37 PM|LINK
Its your Complete Solution
and code on button click or DropdownSelectedIndex change
write
Open this Image in a new tab
Good luck`
Mahad Bin Mukhtar
Remember to Mark the replies as Answers
The easiest day was 'yesterday'.
MCP, MCSD
For .NET TECH Blog
MahadTECH
Star
8978 Points
1660 Posts
Re: select value in the dropdownlist and show different tables
Jun 01, 2012 11:39 PM|LINK
and this is download link of your Solution
Sample : http://www.4shared.com/rar/XTLUujx_/WebSite4.html
Good luck`
Mahad Bin Mukhtar
Remember to Mark the replies as Answers
The easiest day was 'yesterday'.
MCP, MCSD
For .NET TECH Blog
zemzela
Member
20 Points
41 Posts
Re: select value in the dropdownlist and show different tables
Jun 02, 2012 12:13 AM|LINK
I tried the code , it works fine when I run, but when I select value from the drop down list says:
Sql Exception was unhandled by user code
Invalid object name 'Electronics'.
points to: GridView1.DataBound();
What I missed?
MahadTECH
Star
8978 Points
1660 Posts
Re: select value in the dropdownlist and show different tables
Jun 02, 2012 12:17 AM|LINK
if it is showing Errors For Every Selection of your Dropdown.. (Dropdown is Table Name) Its Error
And if its Showing Error for "Electronics" only It means there is no Table Name "Electronics"
Mahad Bin Mukhtar
Remember to Mark the replies as Answers
The easiest day was 'yesterday'.
MCP, MCSD
For .NET TECH Blog
MahadTECH
Star
8978 Points
1660 Posts
Re: select value in the dropdownlist and show different tables
Jun 02, 2012 12:25 AM|LINK
try to Change a Little code like
DropDownList1.SelectedValue
Mahad Bin Mukhtar
Remember to Mark the replies as Answers
The easiest day was 'yesterday'.
MCP, MCSD
For .NET TECH Blog