Server Error in Application

An unhandled exception occurred during the execution of the current web request
posts - 60, comments - 75, trackbacks - 50

My Links

News

Archives

Post Categories

ASP.NET

Items collection cannot be modified when the DataSource property is set.

Items collection cannot be modified when the DataSource property is set.

This exception

“Items collection cannot be modified when the DataSource property is set.”

occurs when you trying to add some text like “Select” or “None” in combo box (drop down list) in .NET framework window form control. There is no such way to add items in combo box’s items property after you set DataSource. To avoid this you can add one more item in your datasource. For example if you are trying to bind drop down list through DataSet then add one more row into DataSet. There is one more workaround for

“Items collection cannot be modified when the DataSource property is set.”


Related Post:

Association, Aggregation, Composition object relationship

Talent vs Attitude – Harsha Bhogle

What we can learn from Babies

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Wednesday, December 26, 2007 7:59 PM | Filed Under [ ASP.NET C# Web Services Design Pattern BizTalk unhandled exception ]

Feedback

Gravatar

# re: Items collection cannot be modified when the DataSource property is set.

Can insert an item in combobox after setting datasource property
3/24/2008 7:40 PM | Pradeep
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: