System.Data.DataRowView on Valuemember of Combobox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Philippe Winter
    New Member
    • Dec 2010
    • 2

    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.Dat aRowView. 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)
    {
    bdwinterDataSet TableAdapters.f bosTableAdapter ta = new Sistema.bdwinte rDataSetTableAd apters.fbosTabl eAdapter();
    cboFboNome.Data Source = ta.ComboFbo(des tino);
    cboFboNome.Disp layMember = "Nome";
    cboFboNome.Valu eMember = "idFBOs";
    cboFboNome.Refr esh();
    }

    Please help me out
  • Timothy Corey
    New Member
    • Dec 2010
    • 1

    #2
    Whenever I've come across the error System.Data.Dat aRowView 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:
    This is not the page you were looking for. Hopefully, you find the perfect course for you soon.

    Comment

    • Philippe Winter
      New Member
      • Dec 2010
      • 2

      #3
      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

      Comment

      Working...