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
505 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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
 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
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…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

729 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