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
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.