query
-
hi.. is there any way i can insert a full collection into a dropdown list? what ia m trying to do is this : there are 2 dropdownlists one has the name of some tables when the user select one of the tables and then moves on to the next dropdownlist, the second dropdown list is populated with all the fields of the selected table name in the first combobox. now i have a problem with generating an ON_CLICK event for the combo box and also i would like to know how to fill the dropdownlist with all the fields?? shoudl i put all the data in collection?? can a collection be directly inserted to a dropdownlist? hope someone can pls help me... tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
-
hi.. is there any way i can insert a full collection into a dropdown list? what ia m trying to do is this : there are 2 dropdownlists one has the name of some tables when the user select one of the tables and then moves on to the next dropdownlist, the second dropdown list is populated with all the fields of the selected table name in the first combobox. now i have a problem with generating an ON_CLICK event for the combo box and also i would like to know how to fill the dropdownlist with all the fields?? shoudl i put all the data in collection?? can a collection be directly inserted to a dropdownlist? hope someone can pls help me... tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
Assuming that this is a SQl querry, and in ASP.NET web page (ASPX) You can set the datasource of your dropdownlist # 1 to the dataset that returns the list of tables and set the text, values accordingly...
drpList.DataSource = dm.GetValues() drpList.DataTextField = "textField" drpList.DataValueField = "valueField" drpList.ClearSelection() drpList.DataBind() drpList.Items.Insert(0, New ListItem("Select", ""))
By the way, you can add the dropdownlist # 2 on the SelectedIndexChanged, for ur first dropdownlist.. Here you have to take care that dropdownlist # 2 takes no value when the 'Select' is selected in the dropdownlist # 1. Hope it is clear.. I was born intelligent
Education ruined me!. -
Assuming that this is a SQl querry, and in ASP.NET web page (ASPX) You can set the datasource of your dropdownlist # 1 to the dataset that returns the list of tables and set the text, values accordingly...
drpList.DataSource = dm.GetValues() drpList.DataTextField = "textField" drpList.DataValueField = "valueField" drpList.ClearSelection() drpList.DataBind() drpList.Items.Insert(0, New ListItem("Select", ""))
By the way, you can add the dropdownlist # 2 on the SelectedIndexChanged, for ur first dropdownlist.. Here you have to take care that dropdownlist # 2 takes no value when the 'Select' is selected in the dropdownlist # 1. Hope it is clear.. I was born intelligent
Education ruined me!.i have some doubts... wht is dm?? is it a dataset containing the values i need? wat does the below lines do? drpList.DataTextField = "textField" drpList.DataValueField = "valueField" tks a lot... appreciate your help "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
-
Assuming that this is a SQl querry, and in ASP.NET web page (ASPX) You can set the datasource of your dropdownlist # 1 to the dataset that returns the list of tables and set the text, values accordingly...
drpList.DataSource = dm.GetValues() drpList.DataTextField = "textField" drpList.DataValueField = "valueField" drpList.ClearSelection() drpList.DataBind() drpList.Items.Insert(0, New ListItem("Select", ""))
By the way, you can add the dropdownlist # 2 on the SelectedIndexChanged, for ur first dropdownlist.. Here you have to take care that dropdownlist # 2 takes no value when the 'Select' is selected in the dropdownlist # 1. Hope it is clear.. I was born intelligent
Education ruined me!.you also said: You can set the datasource of your dropdownlist # 1 to the dataset that returns the list of tables and set the text, values accordingly... how can i do this?? tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
-
i have some doubts... wht is dm?? is it a dataset containing the values i need? wat does the below lines do? drpList.DataTextField = "textField" drpList.DataValueField = "valueField" tks a lot... appreciate your help "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
I am sorry, that I didnt make enough changes in my source code for u to understand... Joseph R. Thomas wrote: wht is dm?? thats my object... hmmm.... u can just replace "dm.GetValues()" with the function that returns the DATASET - containing the information = tables list from ur db source. Joseph R. Thomas wrote: drpList.DataTextField = "textField" drpList.DataValueField = "valueField" now... u will have to replace this code as,
drpList.DataTextField = "TABLENAME" drpList.DataValueField = "TABLENAME"
where TABLENAME, is the 'column' name that carries the list of tables that u take in the querry. I was born intelligent
Education ruined me!. -
you also said: You can set the datasource of your dropdownlist # 1 to the dataset that returns the list of tables and set the text, values accordingly... how can i do this?? tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
JOSEPH, I have replied this in the other message. By The Way, please go through the documentation for 'DATABIND'ing of the lists - like dropdownlist/datagrid/checkboxlist etc. You will get a better idea on 'datasource', 'text', 'value' etc. I was born intelligent
Education ruined me!.