Hello !
i'm using entity framework , and i have a form with bindingsource , and some bound textboxes ( all bound at design time)
Depending to some option that user select , i need to display all the records , or some of the records , or no records.
i have a button select , and on Click event i have :
if contitions1 then
Mybindingsource.datasource=From t in context.table1 where ....... some conditions
select t
else
Mybindingsource.datasource=context.table1
end if
Everything is ok when the instruction in else section is executed , or when the From.... Where..... select result non empty.
When From....where.... select is empty i get an error :
Cannot bind to the property or column xxxxxxx on the DataSource.
Parameter name: dataMember
what can i do ?
Because i need that the textboxes controls on form becomes empty if no records on selection.
thank you.