accessing fields in typed dataset

G

Guest

Hello

I'm having an issue accessing fields in a typed dataset while using data binding. I'm using a BindingManagerBase and binding context with the .AddNew() (which is supposed to automatically create new row on datatable and go there) method on BMB and then EndCurrentEdit(). The fields on the form are bound to a table/column in the dataset, and all works well if I only use the binding but there are situation where I want to access the new row's fields without binding, but through code. I've tried to use the 'NewXXXXTableRow' property of the typed dataset to get a handle to the new row, but any assignments I try to do on columns there give me Invalid Casts when I know the assignment is OK.

Anyone with any suggestions

Thanks

G
 
M

Miha Markic [MVP C#]

Hi,

Gargantua said:
Hello,

I'm having an issue accessing fields in a typed dataset while using data
binding. I'm using a BindingManagerBase and binding context with the
..AddNew() (which is supposed to automatically create new row on datatable
and go there) method on BMB and then EndCurrentEdit(). The fields on the
form are bound to a table/column in the dataset, and all works well if I
only use the binding but there are situation where I want to access the new
row's fields without binding, but through code. I've tried to use the
'NewXXXXTableRow' property of the typed dataset to get a handle to the new
row, but any assignments I try to do on columns there give me Invalid Casts
when I know the assignment is OK.
Anyone with any suggestions?

Care to show some code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top