Where are server connections stored in project?

  • Thread starter Thread starter richard
  • Start date Start date
R

richard

Has anyone come across the scenario where you create a data adapter in
VS.NET 2003 using the IDE along with its related data connector on
computer A. When you copy the project to computer B and try to
configure the data adapter the data connection disappears and you have
to allow the wizard to recreate the data connector.

This is purely a problem at design time as at runtime it is easy to
point the connection wherever you want it via a dynamic connection
string property.

It seems to me that any connections you create in the server explorer
are created for the computer you created them on. When you load the
project on a different computer the server explorer connections are
gone and you have to re-create them.

This is a real pain in the ASP as I often create a project on my
desktop PC at work, check it into source safe then check it out onto
my notebook to work offsite. If I need to modify any data adapters on
the notebook using the wizards i.e. "Generate Dataset" - the whole
thing goes completely runny ( loads of errors & warnings ) until I
allow the IDE to create a new data connector and modify all the data
adapters to reference the newly created connector.


Any ideas / suggestions greatly appreciated!
 
To get around, You can use the period (.) as DataSource. This will work with
SQL Instant on your PC at work, your laptop, and remote server. You also
need to reference the same database (catalog) on all 3 machines (have to). I
use SQL authentication, it seems working fine across machines.

Example:

Data Source=.;
Initial Catalog=Northwind;
User ID=sqlLogonID;
Password=xxxx;
Packet Size=4096;

The above connection string will work with all three machines: My PC in my
office, my Laptop on my laps, and my remote server in St. Paul. Just make
sure SQL/ ID & PW are the same on all 3 places. Once development is
completed, you can change the connection from SQL to Windows Integrated.and
or encrypt the connection string via Web.Config while still enjoying the
design time feature.

John
 
So using "." as the data source just says use the default SQL instance
on the machine you're developing on?

Is there any similar trick when using MS Access databases?
 
Eric The Viking said:
So using "." as the data source just says use the default SQL instance on
the machine you're developing on?
Yes.

Is there any similar trick when using MS Access databases?

I donot know much about MS/Access. But I know this: In Access, you must
specify absolute path in the connecton string. So, I assume that as long as
the path is the same on all 3 places, you should be fine.

John
 
Back
Top