Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2745
The ValueMember property of my WinCombo isn't accepting its value.
posted

Hello!

The datasource of this  WinCombo is a dataTable that is generated from a query that  returns two fields that have the same name, due to a relationship between two tables. When I set this ValueMember property is says that *key not found*. I have tried with both the Column name it self and with TableName.ColumnName but none of these work. Any ideas?

If I use another column name in this datatable that is the only one of its kind it works perfectly....

Of course I can create this query in another way so that I only get one field of these...

Thanks for the help!

/Henrik

 

Parents
No Data
Reply
  • 2745
    Offline posted

    Hello again!

    Thanks for the answer. I know that using the AS clause in my SQL statement as well as simply removing the duplicate field will solve the issue. But the reason I asked was that usually you get a unique identifier by using the TableName.FieldName but I couldn't get that to work here. My first column/field in my datatable was this ambiguous field of type *number* and when i looked for the column name using datatable.columns(0).columnname something it returned tablename.fieldname since it's represented in another column as well. For the fields that are unique, it only showed the field name straight off. so it made sence putting the tablename.fieldname as the valuemember...

    But now I know that I have to use a unique field as the ValueMember, and that the tablename.fieldname isn't really working...

    Thanks again!

    /Henrik 

     

     

Children
No Data