473,395 Members | 1,678 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.

System.Data.DataRowView

Why when I execute this code, my DropDownList is populated with the value
"System.Data.DataRowView"????

See the code:
cmdCommand.CommandText = "SELECT UsuaNome FROM usuarios"

dapAdapter.SelectCommand = cmdCommand 'dapAdapter is a DataAdapter
dapAdapter.Fill(dtsDataSet, "Usuarios")

drpLigaAten.DataSource = dttUsuarios 'dttUsuarios is a DataTable
drpLigaAten.DataBind() 'drpLigaAten is a DropDownList
Thank's
Jul 21 '05 #1
3 12265
André,
When binding to a DataTable, you need to set the DataTextField &
DataValueField properties, to the field to display & the field to return
respectively.

Hope this helps
Jay

"André Almeida Maldonado" <de***@bol.com.br> wrote in message
news:ei**************@tk2msftngp13.phx.gbl...
Why when I execute this code, my DropDownList is populated with the value
"System.Data.DataRowView"????

See the code:
cmdCommand.CommandText = "SELECT UsuaNome FROM usuarios"

dapAdapter.SelectCommand = cmdCommand 'dapAdapter is a DataAdapter
dapAdapter.Fill(dtsDataSet, "Usuarios")

drpLigaAten.DataSource = dttUsuarios 'dttUsuarios is a DataTable
drpLigaAten.DataBind() 'drpLigaAten is a DropDownList
Thank's

Jul 21 '05 #2
Hy Jay... Sorry, but I'm beginner....

Can you give me more details or a web page that explain it???

Thank you.
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> escreveu na
mensagem news:OF**************@TK2MSFTNGP11.phx.gbl...
André,
When binding to a DataTable, you need to set the DataTextField &
DataValueField properties, to the field to display & the field to return
respectively.

Hope this helps
Jay

"André Almeida Maldonado" <de***@bol.com.br> wrote in message
news:ei**************@tk2msftngp13.phx.gbl...
Why when I execute this code, my DropDownList is populated with the value "System.Data.DataRowView"????

See the code:
cmdCommand.CommandText = "SELECT UsuaNome FROM usuarios"

dapAdapter.SelectCommand = cmdCommand 'dapAdapter is a DataAdapter
dapAdapter.Fill(dtsDataSet, "Usuarios")

drpLigaAten.DataSource = dttUsuarios 'dttUsuarios is a DataTable
drpLigaAten.DataBind() 'drpLigaAten is a DropDownList
Thank's


Jul 21 '05 #3
André,
Just set the properties to the names of the fields.

Something like:
drpLigaAten.DataSource = dttUsuarios 'dttUsuarios is a DataTable drpLigaAten.DataTextField = "Field1"
drpLigaAten.DataValueField = "Field2" drpLigaAten.DataBind() 'drpLigaAten is a DropDownList

http://msdn.microsoft.com/library/de...isualBasic.asp

Hope this helps
Jay

"André Almeida Maldonado" <de***@bol.com.br> wrote in message
news:ey*************@TK2MSFTNGP11.phx.gbl...
Hy Jay... Sorry, but I'm beginner....

Can you give me more details or a web page that explain it???

Thank you.
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> escreveu na
mensagem news:OF**************@TK2MSFTNGP11.phx.gbl...
André,
When binding to a DataTable, you need to set the DataTextField &
DataValueField properties, to the field to display & the field to return
respectively.

Hope this helps
Jay

"André Almeida Maldonado" <de***@bol.com.br> wrote in message
news:ei**************@tk2msftngp13.phx.gbl...
Why when I execute this code, my DropDownList is populated with the

value "System.Data.DataRowView"????

See the code:
cmdCommand.CommandText = "SELECT UsuaNome FROM usuarios"

dapAdapter.SelectCommand = cmdCommand 'dapAdapter is a DataAdapter
dapAdapter.Fill(dtsDataSet, "Usuarios")

drpLigaAten.DataSource = dttUsuarios 'dttUsuarios is a DataTable
drpLigaAten.DataBind() 'drpLigaAten is a DropDownList
Thank's



Jul 21 '05 #4

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

Similar topics

1
by: GeraldBauer | last post by:
I am experiencing some weird behaviors with the listbox and dataview. Here is a boiled down code snippet of what I am trying to do. <snippet> string MENUID = "MenuId" , ITEM = "Item" ,...
2
by: kscdavefl | last post by:
I am trying to fill a datalist with table names from an Oracle database. The program works fine using the following code: private void GetTables() { // open a database connection string con...
5
by: karim | last post by:
I am getting the error below when I try to use DataRowView in my aspx page. I am using the System.Data in my code behind. I even tried importing system.Data in the aspx. I have to qualify it with...
1
by: Arjen | last post by:
Hello, Does somebody haves a solution for this? Thanks! Line 74: if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {
2
by: etropic | last post by:
I am trying to bind two tables to two different list boxes Ther tables are working as I use them on another page wth no problems The code is as follows... private void Page_Load(object...
0
by: MS | last post by:
I am very new to asp.net. Please help me in resolving the error: DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name RENEW_EXIST. I get the above error with the...
2
by: Grigs | last post by:
I have a C# Web Service that some of the methods (ones that return integers) work and some do not (the ones that return a DataView. Here is some code in the WebService that is giving me the...
3
by: Jerry | last post by:
Hi I have a combo box that is populated by an ole db connection to a ms access table (Valuewave). The column that is used in the table is called waves. The combo box is populated with the...
3
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
This is what i'm using and it seems way too complicated!! for finding a data item. I hope some one has a better way? private void fn_setRankingColor(GridViewRow gvr) { Label lbl =...
4
by: Arch Stanton | last post by:
I'm trying to bind data in a dataset (obtained from an Access DB) to a listbox in ASP.net. I know my dataset is being created properly because it displays fine in a datagrid, but I can't get it to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.