Debugging designer instantiation

G

GKG

Hello...Im using VS.net and i have a problem with the
windowsfrom designer it when i attempt to bring up the
designer for a form (that is derives another form i made)
i get an exception message ("ExecuteReader requires an
open and available Connection. The connection's current
state is Closed") in a message box and when i click ok it
show X...An error has occured ........ instead of the form

Now how can i find out where this error occurs, can i
somehow debug this instantiation, that occurs when
starting the designer, using breakpoint and such like
when debugging the program?
 
J

Joe \(want to be MVP\)

When the designer opens a form that inherits another form,
it will run what ever is in the load event of the other
form.

You should go to that form and put this in

if not designmode then
'put all code of loadevent here
end if

The designer will hit the load event and since it's in
design mode, it will jump over the code and your problem
goes away.

Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top