473,395 Members | 2,006 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 on Valuemember of Combobox

Hi,

Im trying to set a primary key as valuemmeber of a Combobox. The problem is that it wont show the correct data, it show always System.Data.DataRowView. But it works fine when I change the column to one that has no numbers (int. Below is the code:

private void ComboFbo(string destino)
{
bdwinterDataSetTableAdapters.fbosTableAdapter ta = new Sistema.bdwinterDataSetTableAdapters.fbosTableAdap ter();
cboFboNome.DataSource = ta.ComboFbo(destino);
cboFboNome.DisplayMember = "Nome";
cboFboNome.ValueMember = "idFBOs";
cboFboNome.Refresh();
}

Please help me out
Dec 4 '10 #1
2 4381
Whenever I've come across the error System.Data.DataRowView when I'm trying to access data from a dataset at runtime it has been because the field was not specified properly. The same is true for a TableAdapter. I would say the best way to diagnose this would be to create a for loop that cycles through each column name in your TableAdapter. Maybe you are spelling it wrong or maybe it wasn't included in your SQL statement.

If this doesn't work, can you include the SQL statement that you are running as well as the entry that gives the error? Maybe a second set of eyes will see something you missed.

Finally, I've written up how to do something like this in VB.NET. Maybe reading over what I did (including encountering your error) will shed some light on the issue. Here is a link to the article:
http://www.timothycorey.com/blog/?p=8
Dec 5 '10 #2
Hi,

Here is the SQL statement:
SELECT *
FROM fbos
WHERE (Aeroporto = @Aeroporto)

If I choose a column that has only words, then it works, but it fails when i change one of these rows of the column to a number.

Below are the columns of the table:

idFBOs int False
Nome varchar(45) True
Telefone1 varchar(18) True
Telefone2 varchar(18) True
Fax varchar(18) True
Nextel varchar(18) True
Aeroporto varchar(4) True
Contato varchar(45) True
Freq varchar(7) True
Endereco tinytext True
Pais varchar(45) True
Atendimento decimal True
Pernoite decimal True
website varchar(45) True
email varchar(100) True
Banco tinytext True
Agencia varchar(45) True
Conta varchar(45) True
Descricao tinytext True
Dec 5 '10 #3

Sign in to post your reply or Sign up for a free account.

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" ,...
3
by: Dave Bailey | last post by:
When using a dropdownlist in a web app I get the following in the listbox when I run the app System.Data.DataRowView. I tried to convert this using the ToString() method to no avail The code...
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...
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...
2
by: arupasna | last post by:
I am working with datagrid while adding new row in Datagrid getting following problem pls help me out of this problem DataBinding: 'System.Data.DataRowView' does not contain a property with...
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...
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...
1
by: yummy1984 | last post by:
hi all, I am getting the following error : DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'p2_area_name'. Description: An unhandled exception occurred...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.