Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
reflex2dotnet
Yak Posting Veteran
99 Posts |
Posted - 2007-02-16 : 10:29:52
|
Hi everybodyIn my application, i want to bind a dropdownlist in page load.The problem is that, in result, the dropdowmlisst shows rr23whiich is the first data in my result set rr23Code i am using is Sub BindModelNumbers(ByRef accountID As Int32, ByRef contactID As Int32) Dim modelBLL As BLL = New BLL Dim dsAllModels As DataSet dsAllModels = modelBLL.GetAllModles(accountID, contactID) ddlModelSelect.DataSource = dsAllModels.Tables(0).Rows(0)("Model Number").ToString ddlModelSelect.DataTextField = "Model Number" ddlModelSelect.DataBind()the result set has the data of typeModelNumber ID rr23 --- 6 5gr3 --- 24can anyone please help me to figure it outI want to displayrr235gr3......Now displayingrr23Thanks |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2007-02-16 : 10:55:24
|
quote: ddlModelSelect.DataSource = dsAllModels.Tables(0).Rows(0)("Model Number").ToString
You are binding to a particular row in the table; you need to bind to the entire table:ddlModelSelect.DataSource = dsAllModels.Tables(0)- Jeffhttp://weblogs.sqlteam.com/JeffS |
|
|
reflex2dotnet
Yak Posting Veteran
99 Posts |
Posted - 2007-02-16 : 10:57:51
|
Thanks.I got it worked |
|
|
jhermiz
3564 Posts |
Posted - 2007-02-16 : 13:50:27
|
Just an FYI, might be a good idea to name your datasets as well, that way you avoid any issues remembering exactly how to reference it.Just a suggestion :). Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]RS Blog -- [url]http://weblogs.sqlteam.com/jhermiz[/url] |
|
|
|
|
|