all groups > visual studio .net debugging > september 2004 >
You're in the

visual studio .net debugging

group:

Connection Strings in VB.NET2002


Connection Strings in VB.NET2002 Ian Henderson
9/17/2004 10:23:56 AM
visual studio .net debugging:
Good morning folks.

I'm in the process of writing a front-end application in VB2002, which is
bound to a SQL Server 2000 database. I've created a configuration file,
into which I've dumped information that can be used to build up a SQL
connection string (server name, database name, etc).

At the moment, I'm just learning about the intricacies of .NET, so I'm
relying quite heavily on the wizards that come supplied, to create forms
etc. However, what I'm doing is replacing the wizard-written code for the
SQL connection string (sqlconnection1.ConnectionString.yada yada yada) with
my own code which reads the relevant values from the config file, allowing
me a fully dynamic system (using cn.ConnectionString =
m_oAppConfig.ConnectionsString)

What I've noticed is that sometimes, VB.NET just seems to chew the
connection string out of the form, without flagging any kind of error
message (until you go to use the connection string). Can anyone advise me
as to why this is happening? I'd initially thought that SourceSafe was
doing something to my code, but I've also experienced this issue at home,
where I don't use SourceSafe.

Any help would be greatly appreciated on this.

TIA



Ian Henderson
The Essentiagroup

Re: Connection Strings in VB.NET2002 Sylvain Lafontaine
9/19/2004 7:47:50 PM
This thing will happen if you try to modify the code directly inside the
function InitializeComponent() or inside any other region directly generated
by VS.NET.

If you want to modify the code generated by VS.NET, you should take away
from this function the part that you want to modify.

S. L.

[quoted text, click to view]

AddThis Social Bookmark Button