Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2006

Tip: Looking for answers? Try searching our database.

stop dbconnection in InitializeComponent()

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jarb - 26 Oct 2006 03:00 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.