Are you trying to add to the collections property from the Properties Sheet? Try just using it in code and see if you duplicate the problem.
>Cathi,
>
> thanks for the response. We are creating an intranet app and we need to create a custom control that will be used for data manipulation(Insert, update and deleting records). We will be using the control on most of our webforms. When I add a collection property to my control it appears in the property sheet with the elipse button. I click the elispe button and the SqlParameter collection screen appears. This is good. When I click the add button on the screen I get an error message that says "Object Reference not set to an instance of an object" The code for the get and set methods property is below. Any idea why I'm getting the error message?
>
>private System.Data.SqlClient.SqlParameterCollection insertparms;
>public System.Data.SqlClient.SqlParameterCollection InsertParameters
>{
> get
> {
> return this.insertparms;
> }
> set
> {
> this.insertparms = value;
> }
>}
>
>>Jim,
>>
>>Yes you can add a property "As" a collection. I don't have any quick examples or articles to point you to but I have seen it in code (I just can't remember where). You first create a class that inherits from a collection class. Then you base your property on the custom class. The Get and Set of the property would access methods of your custom class to extract the data you want. Hopefully this helps.
>>
>>>Cathi,
>>>
>>>Is it possible to add a property that is a collection ( say a SQL DataAdapter parameter collection) to a custom control? If so, how would it be done and what would the code be for the get and set functions for the controls? Is there an article on doing this somewhere?
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi