473,320 Members | 1,829 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,320 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 7394
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.