473,395 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Dropdownlist not working

Hi All,

This is what I am trying to do.I have an aspx page with the the following
code block.

<asp:DropDownList id="DropDownList1" runat="server" DataSource="<%#
GetUsers%>" DataTextField="user_email" DataValueField="user_id">
</asp:DropDownList>

GetUsers is defined in the .vb file

Public Function GetUsers() As DataSet

Dim ds As DataSet
ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings("ConnectionString
"), CommandType.Text, "select user_id , user_email from users")
Return ds

End Function
I am kind of frustrated that I cannot make this thing work.What am I doing
wrong ?

--binod

Nov 20 '05 #1
2 877

in your code behind... after you get Users

call

DropDownList1.DataBind()

Peace,
"Binod Nair" <na*******@hotmail.com> wrote in message
news:Of*************@tk2msftngp13.phx.gbl...
Hi All,

This is what I am trying to do.I have an aspx page with the the following
code block.

<asp:DropDownList id="DropDownList1" runat="server" DataSource="<%#
GetUsers%>" DataTextField="user_email" DataValueField="user_id">
</asp:DropDownList>

GetUsers is defined in the .vb file

Public Function GetUsers() As DataSet

Dim ds As DataSet
ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings("ConnectionString "), CommandType.Text, "select user_id , user_email from users")
Return ds

End Function
I am kind of frustrated that I cannot make this thing work.What am I doing
wrong ?

--binod

Nov 20 '05 #2
Wait.. not in yoru get users. but in your load is probably where you'll be
safest.

so on your load procedure.

if not (page.isPostBack) then
me.DropDownList1.DataBind()
end if
"Binod Nair" <na*******@hotmail.com> wrote in message
news:Of*************@tk2msftngp13.phx.gbl...
Hi All,

This is what I am trying to do.I have an aspx page with the the following
code block.

<asp:DropDownList id="DropDownList1" runat="server" DataSource="<%#
GetUsers%>" DataTextField="user_email" DataValueField="user_id">
</asp:DropDownList>

GetUsers is defined in the .vb file

Public Function GetUsers() As DataSet

Dim ds As DataSet
ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings("ConnectionString "), CommandType.Text, "select user_id , user_email from users")
Return ds

End Function
I am kind of frustrated that I cannot make this thing work.What am I doing
wrong ?

--binod

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Stanley J Mroczek | last post by:
How do you load a dropdownlist when edit is clicked in a datagrid ? <Columns> <asp:BoundColumn DataField="OptionDescription" ItemStyle-Wrap="True" HeaderText="Option...
1
by: m3ckon | last post by:
Hi there, please help if you can, I'm having an issue with droponnlists in a datagrid I have a datagrid which is populated from a query .. all works fine I've added two extra columns, one...
0
by: Juanjo | last post by:
Hi, Before, I was working with Asp.net 1.0 and datagrid. I posted a question for this issue. The solution of this problem is load the second dropdownlist on the selectedindexchanged event of the...
0
by: Juanjo | last post by:
Hi, Before, I was working with Asp.net 1.0 and datagrid. I posted a question for this issue. The solution of this problem is load the second dropdownlist on the selectedindexchanged event of the...
0
by: brian.newman | last post by:
I've created a dropdownlist whose values are drawn from an Access database. This list of items represents a user account. In the same record is a boolean field which records whether the user is...
1
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button...
0
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I...
1
by: Brett | last post by:
I have a DropDownList in an ASP.NET web form that is populated with items from a lookup table by binding that DropDownList to a SqlDataSource. However, the items in the lookup table can change over...
0
by: asmx126453 | last post by:
Hey mensen I am having some big troubles here i tryd solving it myself with internet for 2 days but i kind fix it. Its about this i have a DotNet project that alrydi is online and working for...
3
by: EdisonCPP | last post by:
Hi, I have a DetailsView with a template field with a dropdownlist added to it. If the data coming into that field were put into a textbox, it would look like: Small|Medium|Large|X-Large. I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.