ReadOnly Exception Error when Inserting with an Expression Column

M

Mike Tavares

Hi,

I have am getting the following exception when I try to update my strongly
typed dataset back to the database:

Cannot change ReadOnly property for the expression column

This error occurs when the following conditions are met:

1. The datatable contains an identity field
2. The datatable contains an expression column
3. A new row has been inserted into the datatable
4. The insert command text contains a Select Scope_Identity() statement
after the insert

This error will not occur when I am just updating a row. I think it has
something to do with the retrieving the value from the identity field, but
am not positive.

Does anyone know of a work-around for this bug?

Thanks,
Mike
 
M

Miha Markic

Hi Mike,

I think it has to do with expression columns (insertcommand tries to update
all columns)
Try removing them befure update and re-add them after.
 

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