473,396 Members | 1,775 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,396 software developers and data experts.

VB.NET databind to drop down list

I have a stored procedure in SQL Server that returns a list of names that I
would like to bind to a drop down list. This is the code I have, but it is
not working correctly. The drop down contains System.Data.DataRowView
Dim ConString As String = ConfigurationSettings.AppSettings("cs")
Dim myCon As New SqlConnection(ConString)

Dim CmdTextAssignedToListing As String = "usp_GetAssignedToNames"
Dim CmdAssignedToListing As New
SqlDataAdapter(CmdTextAssignedToListing, myCon)

Dim dsAssignedToListing As New DataSet
'fill drop down with user names
CmdAssignedToListing.Fill(dsAssignedToListing)

'Databind to the Drop Down
DropDownAssignedTo.DataSource = dsAssignedToListing
DropDownAssignedTo.DataBind()

Any help is appreciated.

Jul 21 '05 #1
1 7399
Andy,

You miss the setting of the datatextfield in your dropdownlist
http://msdn.microsoft.com/library/de...fieldtopic.asp

It is now like a datagrid.

I hope this helps,

Cor
Jul 21 '05 #2

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

Similar topics

1
by: tal_mcmahon | last post by:
Hello all, I have a user control (ascx) that has a DropDownList on it. The User Control exposes the selectedvalue/text of the ddl. The User Control Has a Click event. I place that User...
3
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box...
1
by: Stu Lock | last post by:
Hi, Is there any way to databind a hashtable to a drop down list box using the key/value pair within the hashtable to correspond to the value/text of the drop down list box? ie: hashtable...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
4
by: LU | last post by:
I want to add dropdown boxes based on a databind to a checkboxlist. I database/databind to a checkboxlist but for each checkbox created I want to also create a drop down next to it with some...
1
by: Andy | last post by:
I have a stored procedure in SQL Server that returns a list of names that I would like to bind to a drop down list. This is the code I have, but it is not working correctly. The drop down...
5
by: Jurgen Appelo | last post by:
I'm at a loss here... My FormView control automatically performs a databind at each postback on the server. But in some cases I don't want this to happen. Like when the business layer decides that...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
3
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.