Showing posts with label machines. Show all posts
Showing posts with label machines. Show all posts

Sunday, March 25, 2012

connecting to SQL on network machine

Hi,
I'm trying to use one of my machines as a database server, just for local network testing/development etc. This machine/server is on my local network via a router.
Can anyone advise me of how, when using VS 2005 Beta 2, to connect to my SQL Server 2005 installation on the server running on my network. ? In the 'add connection' dialogue, what do I put in the 'Server name:' field, (apart from server name...) is it the name of the machine or the IP address of the machine on the network ?
Any and all advise appreicated.
Thanks in advance.

Maybe u need to have the Client SQL and to open the enterprise manager to register a new server group
After that u can use it in ur program
HTH

|||

Hi Smiling,

Thanks for the response. I now have everything running/installed on sql 2005 (named pipes, tcp/ip etc) but still no luck, although I now have an error message:
'A connection was successfully established with the server, but then an error occured during the pre-login handshake.(provider: Named Pipes Provider, error: 0 -No process is on the other end of the pipe.)'
On my sql 2005 machine Named Pipes is Enabled and 'Local Access Only' is set to 'No'. If I disable Named Pipes I get the same error message !
I have tried your suggestion and registered new server group and specified Named Pipes as the Network Protocol etc. no luck.
any further advice appreciated.

|||i have the same problem.. i receive the same error message if i want toconnect to the database (sql 2005 beta 3) through vs2005.
any ideas ?

Thursday, March 22, 2012

Connecting to SQL 2005 from other machines

The April CTP was working well but both the June and Sept CTP seem to be having problems with connections outside the local machine. It does not seem to matter how the connection is to be established (from code, from SQL managment studio etc) the same error comes up repeatedly.

Cannot connect to SEPTCTP.

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233)

Any suggestions besides rolling back to the April CTP (our current solution)?

Is the Named Pipes protocol enabled on server?
On server machine, run SQL Server configuration manager,
open SQL Server Network Configurations and enable Named Pipes.
Or switch client to use TCP/IP protocol rather than Named Pipes.

Thanks,
Michael.

P.S. This seems to be general SQL question, you might
get better response in SQL Server Database Engine group,
rather than in this SSIS-specific group.|||I'm not sure why, but we needed to access remote servers with their IP address AND a specific non-standard port once we upgraded to the newest CTP. This seemed fine for our test applications (we're not releasing anything until the final version is released).

Josh|||

This should be fine, provided that client is also configured

to use TCP/IP protocol and appropriate port. But the error

indicates the connection is using Named Pipes protocol.

It seems like the connection or SQL Client defaults is not

configured properly.

I'm not really a pro in SQL Client configuration, forum
SQL Server Database Engine might have people more
knowlegable in this area.

The answer may depend on whether you are using OLEDB or
ADO.NET connection managed, and in former case - SQL Native
OLEDB provider or Microsoft OLEDB provider for SQL Server.

Tuesday, March 20, 2012

Connecting to remote database?

I am using SQL Server 2000 database in my VB.Net project.

My VB.net application is installed one two machines in different cities i.e. there are two separate databases.

First machine's IP address is say 202.33.44.55 and other machine IP address is say 203.33.55.66. Now I want to use each others databases i.e. I want to set their database group.

So that in my VB.Net's application which is installed on 202.33.44.55 I could see data of the 203.33.55.66 by just changing the connection string

You can include both connection strings in the web.config and then change the data source via dynamic code.

This method works well when there are applications running on the server with each using a different data source.

The web.config might look like this:

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<clear />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=servername;Initial Catalog=database;User ID=user;Password=password;" providerName="System.Data.SqlClient" />
<remove name="ConnectionString1"/>
<add name="ConnectionString1" connectionString="Data Source=servername1;Initial Catalog=database1;User ID=user;Password=password;" providerName="System.Data.SqlClient" />
<remove name="ConnectionString2"/>
<add name="ConnectionString2" connectionString="Data Source=servername2;Initial Catalog=database2;User ID=user;Password=password;" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>

|||

harshal_shravgi:

I am using SQL Server 2000 database in my VB.Net project.

My VB.net application is installed one two machines in different cities i.e. there are two separate databases.

First machine's IP address is say 202.33.44.55 and other machine IP address is say 203.33.55.66. Now I want to use each others databases i.e. I want to set their database group.

So that in my VB.Net's application which is installed on 202.33.44.55 I could see data of the 203.33.55.66 by just changing the connection string

There is nothing dynamic in this Asp.net needs an account in the second server which should be added to SQL Server and the database, so you need to create a Windows account for Asp.net in the second server and grant that account permissions to SQL Server and the database. Hope this helps.

|||

Actually I want to set their database groups and as I said those two machines are not in my LAN. Those two machines are in different cities.

When I try setup a new sql group then I cann't see 203.33.55.66 from 202.33.44.55.

Above two IP addresses will be live IP address.

|||

harshal_shravgi:

Actually I want to set their database groups and as I said those two machines are not in my LAN. Those two machines are in different cities.

When I try setup a new sql group then I cann't see 203.33.55.66 from 202.33.44.55.

Above two IP addresses will be live IP address.

I have told you what you need to do location is not relevant if you do it your application will run, some of these security issues are created by developers who thinks database servers should let their application run without valid permissions.

|||

In my code I am using following connection string -

Provider=SQLOLEDB.1;Data Source=202.33.44.55;Initial Catalog= SLV2;UserId=sa;Password=;

It gives error that database does not exist.

What should I give datasource that database does not exist on my machine i.e. 203.33.55.66? And as I said when I tried to setup a new group in SQL Server then its not showing me that other machine database.

So I think its not the issue of coding, firstly I should be able set a group of databases in SQL Server then only I will be able to use it in my code.

|||

Hi,

You also need to check if the SQL Server instance you're connecting to is the default instance on 203.33.55.66. Is the instance on the default port 1433?

Please also check if the database named SLV2 exists on that machine and if sa with no password is a valid user name.

You can test this with SQL Server management studio or with a UDL file. Here are the steps creating a UDL file.

1. Create a text file on your desktop and rename it to XXX.udl
2. Double click on the file and a Data Link Property dialog box will be shown.
3. Setup the connection and use Test Connection button to test it.

HTH.

|||

Exactly when I tried to connect using .UDL file I didn't found that other machine.

So what to do now?

|||

harshal_shravgi:

Exactly when I tried to connect using .UDL file I didn't found that other machine.

So what to do now?

You need to create a domain account for Asp.net then grant that account permissions in SQL Server and database, sa is not a Windows account.

http://support.microsoft.com/kb/328306

|||

Hi,

And you can also connect to the database using SQL authentication. But the server should enable SQL authentication first.

HTH.

Wednesday, March 7, 2012

Connecting to a Network Server - a simple question !!

Hi

My question should be relatively simple.

I have a server machine (Windows XP + SQL SERVER 2005 EXPRESS) : IP (192.168.1.1)

2 client machines:

Client 1 (Windows XP + SQL SERVER 2005 EXPRESS) : IP (192.168.1.100)

Client 2 (Windows XP + SQL SERVER 2005 EXPRESS) : IP (192.168.1.101)

I want to connect the 2 clients to the server database in a simple client\server arch.

what should I do ?!!!

Thank you in advance.

By default SQL EXPRESS does not allow remote connections and is meant to be used as a Client database only.

You can enable the Remote Connections with configuration tools, but there are limitations.

I am not sure what you mean in a Client Server architecture, as you are using all Client OS versions, and connecting SQL - SQL would not necessarily be a Client Server arch.

More info would help as to what you are trying to accomplish in setting up 3 instances of SQL Server to talk to each other (other than replication, etc).

Ben Miller

|||

developer00x wrote:

Hi

My question should be relatively simple.

I have a server machine (Windows XP + SQL SERVER 2005 EXPRESS) : IP (192.168.1.1)

2 client machines:

Client 1 (Windows XP + SQL SERVER 2005 EXPRESS) : IP (192.168.1.100)

Client 2 (Windows XP + SQL SERVER 2005 EXPRESS) : IP (192.168.1.101)

I want to connect the 2 clients to the server database in a simple client\server arch.

what should I do ?!!!

Thank you in advance.

Hi Developer00x,

You will need a minimum install of sql server 2005 standard edition to achieve what you are attempting to do...
Barry Andrew|||I am not sure, why he should need a Std. Edition for the scenario described as he did not mention anything about replication or something else. If he just wants to connect to the server from the clients, he will just need to have any SNAC / OLEDB / MDAC (which is shipped with Windows XP) and enable remote connections like Ben suggested.

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||Problem solved ..
Thank you,