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
499 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
Comment Utility

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

Author Comment

by:jxharding
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Expert Comment

by:whittall
Comment Utility
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
Comment Utility

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
Comment Utility
a lot of info , thanks, i'll be going through it now, and replying
0
 

Author Comment

by:jxharding
Comment Utility
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
Comment Utility
Try server=PC1 (No Brackets)

Alan
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

762 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

12 Experts available now in Live!

Get 1:1 Help Now