Geeks With Blogs
Server Error in Application An unhandled exception occurred during the execution of the current web request

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

 

Posted on Wednesday, December 26, 2007 7:59 PM ASP.NET , C# , Web Services , Design Pattern , BizTalk , unhandled exception | Back to top


Comments on this post: Items collection cannot be modified when the DataSource property is set.

# re: Items collection cannot be modified when the DataSource property is set.
Requesting Gravatar...
Can insert an item in combobox after setting datasource property
Left by Pradeep on Mar 24, 2008 7:40 PM

Your comment:
 (will show your gravatar)


Copyright © Mahesh Singh | Powered by: GeeksWithBlogs.net