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

DataBind

How can I bind data with a DropDownList... I use a code that return no
errors but don't populate de DropDownList... See the code:
Dim conBanco = New
SQLConnection("server=(local)\NetSDK;database=Digi express;Integrated
Security=SSPI")
Dim cmdCommand As SqlCommand = conBanco.CreateCommand()

conBanco.open()

Dim dtrDataReader as SqlDataReader
cmdCommand.CommandText = "SELECT usuanome FROM usuarios"

dtrDataReader = cmdCommand.ExecuteReader()

drpLigaAten.DataSource = dtrDataReader
drpLigaAten.DataBind()

dtrDataReader.Close()
Jul 21 '05 #1
2 1640
try to use dataset/datatable/dataview instead of datareader.

I think, datareader does not implement ilistsource interface.

Rajesh Patel.
"André Almeida Maldonado" <de***@bol.com.br> wrote in message
news:uv****************@TK2MSFTNGP11.phx.gbl...
How can I bind data with a DropDownList... I use a code that return no
errors but don't populate de DropDownList... See the code:
Dim conBanco = New
SQLConnection("server=(local)\NetSDK;database=Digi express;Integrated
Security=SSPI")
Dim cmdCommand As SqlCommand = conBanco.CreateCommand()

conBanco.open()

Dim dtrDataReader as SqlDataReader
cmdCommand.CommandText = "SELECT usuanome FROM usuarios"

dtrDataReader = cmdCommand.ExecuteReader()

drpLigaAten.DataSource = dtrDataReader
drpLigaAten.DataBind()

dtrDataReader.Close()

Jul 21 '05 #2
But just for populate a DropDownList I have to create a DataSet, DataTable,
DataView????

This will use too much memory, doesn't it???

Thank's...
"Rajesh Patel" <rd****@hotmail.com> escreveu na mensagem
news:%2******************@TK2MSFTNGP09.phx.gbl...
try to use dataset/datatable/dataview instead of datareader.

I think, datareader does not implement ilistsource interface.

Rajesh Patel.
"André Almeida Maldonado" <de***@bol.com.br> wrote in message
news:uv****************@TK2MSFTNGP11.phx.gbl...
How can I bind data with a DropDownList... I use a code that return no
errors but don't populate de DropDownList... See the code:
Dim conBanco = New
SQLConnection("server=(local)\NetSDK;database=Digi express;Integrated
Security=SSPI")
Dim cmdCommand As SqlCommand = conBanco.CreateCommand()

conBanco.open()

Dim dtrDataReader as SqlDataReader
cmdCommand.CommandText = "SELECT usuanome FROM usuarios"

dtrDataReader = cmdCommand.ExecuteReader()

drpLigaAten.DataSource = dtrDataReader
drpLigaAten.DataBind()

dtrDataReader.Close()


Jul 21 '05 #3

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

Similar topics

0
by: autofill | last post by:
2 scenario inside a WebUserControl. I want to know why Microsoft and so many book doesn't suggest us to work like that. This control going to be in my page and I will call the DataBind of my...
2
by: Stephen | last post by:
Hey everyone. I was wondering if someone could help me with a small problem. I have designed a user control and I would have inserted it on a aspz page (WebForm1). The User control is being used to...
3
by: Marty McDonald | last post by:
I have <asp:Table... </asp:Table> on my webform. In codebehind, I populate a DataTable whose data should appear in the asp:Table. I created my own code to populate the asp:Table with the...
7
by: Martin | last post by:
Hi, I have a page where according to the mode of use, different controls are visible. I had assumed that Page.DataBind() would only bind visible controls, but apparently not. Do I have to...
1
by: Martin | last post by:
Hi, I've got a web label control which I set a databind expression on the Text attribute in the html for the page (aspx file). At runtime, I want to override this attribute, so before I do...
2
by: Jim Bancroft | last post by:
Hi everyone, I have a DropDownList I populate as outlined below. This is from my code-behind file: private void Page_Load(object sender, System.EventArgs e) { BindMyData(); DataBind(); }
1
by: Aayush Puri | last post by:
I was going through an article on datagrid control in ASP.NET and found the use of databind a bit confusing. So the default behavior in a editable datagrid row is to show a Update and a Cancel...
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...
0
by: nicklang | last post by:
Say you are creating a page which contains a child control which uses a DataList or DataGrid control. In a DataList, the rows are dynamic controls and are data bound, so you have to first load the...
1
by: Dunc | last post by:
Has anyone come across a way to bind simple properties (e.g. <%# DateTime.Now.Year %>, <%# UserName %in the underlying HTML) without doing a general DataBind(); call? Not only does it seem a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.