Is there any way to change the order code is generated in InitializeComponent()?
Or to keep designer generated ADO.NET code from trying to connect?
If im dropping data adapters, connections, etc.. in the designer, as soon as the
connection string is set any following code that references the connection
object initiates the connection. I dont want any connection happening until I
ask for it with a Fill() call. I dont want to have to wrap all my constructors
with database exception handlers. Surely there is a way of having some control
over this?
thanks
jarb - 31 Oct 2006 01:31 GMT
> Is there any way to change the order code is generated in
> InitializeComponent()? Or to keep designer generated ADO.NET code from
[quoted text clipped - 8 lines]
>
> thanks
No response on this one. I guess the only way to stop the connection attempts is
to manually edit the designer generated code. Make the connection string = line
be the last line in the function. Unfortunately you have to do this after every
time you open the component in designer because it moves the code around again.