Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Objectdatasource and Read Only ID

Status
Not open for further replies.

nikdiva

Programmer
Jul 27, 2001
17
0
0
US
Hi, I have a FormView bound to an ObjectDataSource that is bound to a BLL. The object has a Read-Only field called "OrganizationId". When I try to update the FormView, I get the following error message:

The 'OrganizationId' property on the type specified by the DataObjectTypeName property in ObjectDataSource 'OrganizationBindingSource' is readonly and its value cannot be set.

How do I get the ObjectDataSource or the FormView to recognize that the id field is readonly, and to not try to update it? *bangs head on screen*


Nikki Wright
 
Simple answer: DON'T use the datasource controls. They are only good for very simple scenarios for displaying data. Once you need to do anything more complicated, the don't work.

Write your own DAL that use stored procedures. Much simpler, and easy to maintain.
 
I'm actually trying to work with a BLL that my boss created to do this. Believe I would much rather roll my own but I have to work within this constraint.

Nikki Wright
 
That is fine that you are using his BLL. What you need is the DAL, Data Access Layer. And have that use stored procedures instead of datasource objects on the page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top