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 / Visual Studio.NET / IDE / February 2005

Tip: Looking for answers? Try searching our database.

IDE Deletes part of my code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eddie - 19 Feb 2005 04:06 GMT
Really weird problem....  

I add code in the

#Region " Windows Form Designer generated code "

section, and the IDE deletes a part of it.  One program reads an ini
file before executing the form's load procedure, and in another
program, it deletes my oledb connection string!  

Here is an example of the code that gets deleted

Me.OleDbConnection1.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & AccessPath & ";"

The data form wizard added this to the form when it created it, I only
changed the connection string.  About every 3rd time I run the app
from the IDE, it deletes this portion of the code.  Everything else is
there, it just deletes these few lines and leaves everything else.
Its as if I this portion of the code was never there

I checked for updates, but there doesn't seem to be any.  I am
running:
Visual Studio.Net Professional 2003 version 7.1.3088  
.Net Framework version 1.1.4322 SP1
Windows Server 2003 Enterprise
       
Thanks in advance
Chad Z. Hower aka Kudzu - 19 Feb 2005 13:40 GMT
Eddie <none@nowhere.org> wrote in news:p1ed11hnnrd4gjjtor6gkoof9cf997bdq9@
4ax.com:
> Really weird problem....  
>
> I add code in the
>
> #Region " Windows Form Designer generated code "

Dont add stuff in here. This is only for the IDE to manage and any code you
add very likely will get trashed as you have just seen.

> section, and the IDE deletes a part of it.  One program reads an ini
> file before executing the form's load procedure, and in another
> program, it deletes my oledb connection string!  

There are other methods that you can modify that actually call this
procedure, so just insert your code in there.

--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
     "Programming is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu
Eddie - 19 Feb 2005 16:31 GMT
OK, if I need to change a connection string that is defined in this
section, where would I do it?  

Will there be a problem if I move the initialization for
Me.OleDbConnection1.ConnectionString before the InitializeComponent()
in the Public Sub New() routine?

I am reading an INI file to determine where the access database is, so
I have to do this before I can initialize the OleDbConnection.

>Eddie <none@nowhere.org> wrote in news:p1ed11hnnrd4gjjtor6gkoof9cf997bdq9@
>4ax.com:
[quoted text clipped - 13 lines]
>There are other methods that you can modify that actually call this
>procedure, so just insert your code in there.
Eddie - 20 Feb 2005 03:37 GMT
I think I answered my own question.  I added the
oleDbConnection1.ConnectionString to Public Sub New after
InitializeComponent() and it worked fine.  

Thanks for the feedback!  I'll know next time :)

>OK, if I need to change a connection string that is defined in this
>section, where would I do it?  
[quoted text clipped - 23 lines]
>>There are other methods that you can modify that actually call this
>>procedure, so just insert your code in there.

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.