S
Seelan
Hello folks,
I have a database table with CategoryID, Name and Description. I
made 2 DropDown Lists one for Displaying Name and the other for
Description. I want to add a web control, lets say a simple Datagrid
that would display the CategoryID depending on the values selected
from the 2 drop down lists. Can some one help me with this please? C#
web forms would be very helpful.
sqlDataAdapter1.Fill(dsCategories11);
DataGrid1.DataBind();
DropDownList1.DataBind();
DropDownList2.DataBind(); //upto this
point data is binded to the ddlist and everything is fine...
sqlDataAdapter1.SelectCommand.CommandText="SELECT CategoryID FROM
Categories WHERE CategoryName="+DropDownList1.SelectedItem.ToString();
sqlDataAdapter1.Fill(dsCategories121);
Datagrid2.DataBind();
//after this I get an error saying "Invalid Coloumn name 'Beverage'
which is the item selected in the drop down list 1.
Please help...
Thanks
Seelan
I have a database table with CategoryID, Name and Description. I
made 2 DropDown Lists one for Displaying Name and the other for
Description. I want to add a web control, lets say a simple Datagrid
that would display the CategoryID depending on the values selected
from the 2 drop down lists. Can some one help me with this please? C#
web forms would be very helpful.
sqlDataAdapter1.Fill(dsCategories11);
DataGrid1.DataBind();
DropDownList1.DataBind();
DropDownList2.DataBind(); //upto this
point data is binded to the ddlist and everything is fine...
sqlDataAdapter1.SelectCommand.CommandText="SELECT CategoryID FROM
Categories WHERE CategoryName="+DropDownList1.SelectedItem.ToString();
sqlDataAdapter1.Fill(dsCategories121);
Datagrid2.DataBind();
//after this I get an error saying "Invalid Coloumn name 'Beverage'
which is the item selected in the drop down list 1.
Please help...
Thanks
Seelan