Resolved VS2008: Argument 'Length' must be greater or equal to zero

Cep

Member
Joined
Apr 29, 2008
Messages
11
Programming Experience
1-3
Hi,

In my project I have decided to create a user control to use on several forms. I have created my user control which is just a mix of combo boxes, text boxes and command buttons, added in methods and properties and then built my project to get the control in my toolbox.

The problem is each time I try to drag the control onto my form I keep getting this message,

"Argument 'Length' must be greater or equal to zero"

I have tried searching on this and cannot find an answer. There is as far as I can see no such argument in any of my code. So I am at a bit of a loss.

Have I missed something out?

[EDIT]
I have since discovered that the error has been caused because when dragging my control to the form in design time, VS will try and connect to the database I am using for the custom control. I have had to move my database code out of the control constructor into its own method.

I then call this method by checking for design time in the load event of the control. This now allows my control to be placed.
 
Last edited:
Back
Top