Solved

how to connect pc1 to its own local server group,connect pc2 to pc1's server group, and use same connstring in app.config

Posted on 2004-10-14
9
500 Views
Last Modified: 2012-06-27
hi, we have 2 pc's developing here.
each pc has sql server & client installed.
each pc's own sql server is called local to themselves.
we share source code so we have 1 app.config file. (source safe)

now i added another sql server group to my pc, pc2.
i called it MYSQL.

now i changed app.config from to
value="server=(local);Trusted_Connection=yes; database=xxxx; UiD=xx;Password=xxx;"/>
to
value="server=(MYSQL);Trusted_Connection=yes; database=xxxx; UiD=xx;Password=xxx;"/>

but it says it cant find the database and now neither of the pc's can connect.
(is the syntax perhaps wrong? i cant use IP address because they are automatically assigned)
what procedure should i follow in order for pc1 to connect to its own local server group.
and pc2 to connect to pc1's server group, and share the same connectionstring in app.config
0
Comment
Question by:jxharding
9 Comments
 
LVL 39

Expert Comment

by:appari
ID: 12316719

try using the name of the other computer in place of (MySQL)
0
 

Author Comment

by:jxharding
ID: 12316741
hi, i tried that , no go. i can see both server groups from my sql server enterprise manager, and mine is called local.
and the other pc's server group is actually the same as the pc name
0
 

Author Comment

by:jxharding
ID: 12316902
is this the way that its supposed to be though , all connection strings incl pc with server, have the name of the pc with the server?
0
 
LVL 7

Expert Comment

by:sukumar_diya
ID: 12316917
Hi,
Please check the authendication mode of the mysql sql server whether it is in Mixed Mode.
Check whether user has permission to acess the database and the objects in the database.
If you are connecting through TCP then Remove the TCP Protocol and save the settings and again add the TCP Protocol.


Try this.. Hope it may help you.

Thanks,
Suku

0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Expert Comment

by:whittall
ID: 12317072
Hi,

Am I missing something.

Server groups in enterprise manager are only a means of organising enterprise managers display of them. You can not connect to these groups, you can only connect to servers.

You can connect to a local database using the machine name instead of (local), so try changing connection string to pc2, both machines should now use the sql server installed on pc2.

Have fun
alan
0
 
LVL 11

Expert Comment

by:rdrunner
ID: 12317128

Also if you are using trusted connections, then you dont need this  "UiD=xx;Password=xxx;" in your connection string. You will authenticate yourself as the User running the software or the User thats impersonated by your website. Make sure they both have access to the SQL Server.

To connect to the server you show first try to figure out if the PC names are resolved properly. To do this you just need to ping the computer where the database is located.

Ping pc1

This should resolve the PC name and return 4 lines with a timing. If you get "not reachable" you dont have a working DNS. But since you said you get the IP automatically this should not be the case.

To figure out the name of the computer running the SQL Server you can goto the SQL Server rightclick on "My Computer" goto Properties and select the "Computername" Tab. You PC name should be listed there.

Just enter this as the Computername.

If it still fails, do a Profiler trace vs your SQL Server and try to watch the logins and see which ones fail.

Hope this helps


0
 

Author Comment

by:jxharding
ID: 12317518
a lot of info , thanks, i'll be going through it now, and replying
0
 

Author Comment

by:jxharding
ID: 12317737
pc2 cannot connect to pc1 if
value="server=(PC1);Trusted_Connection=yes; database=xxxx; UiD=xx;Password=xxx;"/>

now i tried
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectionString"
value="data source=PC2; database=xxx; UiD=xx;Password=xx;"/>
</appSettings>
</configuration>

this works!
comments please!
0
 

Accepted Solution

by:
whittall earned 100 total points
ID: 12318130
Try server=PC1 (No Brackets)

Alan
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now