November 2, 2012 at 4:00 am
Hii i m making a windows application.from my application when i try to connect to database i m getting the following error.....
just not able to figure it out which setting should i use to solve this error.
A network-related or instance-specific error occured while establishing a connection to sqlserver.the server was not found or was not accessible.Verify that the instance name is corredct and that sqlserver is configured to allow remote connections.(Provider-SQL Network Interfaces,,error 26-Error location Server/instance Specified)
Below is my web.config file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<appSettings>
<add key="Con1" value="server=PENTACLE-E8491F;database=POS ;MultipleActiveResultSets=True"/>
</appSettings>
<connectionStrings>
<add name="server" connectionString="Data Source=PENTACLE-E8491F;Initial Catalog=POS;Integrated Security=True;"
providerName="System.Data.SqlClient" />
<add name="POS.Properties.Settings.POSConnectionString" connectionString="Data Source=PENTACLE-E8491F;Initial Catalog=POS;Integrated Security=True;"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
November 2, 2012 at 4:19 am
Can the server where the app is running from ping the SQL server? Is the database POS online? Does the user running the service have access to SQL?
November 2, 2012 at 4:27 am
And is the database on the default instance or a named one?
November 2, 2012 at 4:27 am
I think we will need more information.
The message obviously means it cannot find the server/instance; this may be for a great number of reasons, including:
The server name is incorrect, the instance name is incorrect, the server does not allow remote connections, the firewall is not allowing the connection, you may also need to check if sql browser is running, what connection protocols are enabled/used.
Have a search using your favourite search engine and lots and lots of results will come back with a vast array of things to check.
Back tot he first comment - we will need more info to help, such as connecting to same server or other server, named instance or default instance, firewall settings checked and confirmed or not, default port used, etc
B
November 2, 2012 at 4:41 am
bleroy (11/2/2012)
I think we will need more information.The server name is incorrect, the instance name is incorrect, the server does not allow remote connections, the firewall is not allowing the connection, you may also need to check if sql browser is running, what connection protocols are enabled/used.
Have a search using your favourite search engine and lots and lots of results will come back with a vast array of things to check.
B
i had use my favorite search engine..after searching and seraching i ended up in this forum...
1)i checked my firewall setting it is off
2)i had also tried checking allowing remote connections from sql server configuration tools..i had checked the chekbox using tcp and named pipe both....
3)i m not so sure abt instances name...i think there is something wrong with instances name..or server name....
its a window application .....i m new to this forum...:-)
November 2, 2012 at 4:43 am
Gazareth (11/2/2012)
And is the database on the default instance or a named one?
sir i m not sure abt default or the named one..as i m new to this and for the first time i got this type of error....hope u can understand....
below is the snapshot of sql server configuration manager...
.
November 2, 2012 at 4:47 am
anthony.green (11/2/2012)
Can the server where the app is running from ping the SQL server? Is the database POS online? Does the user running the service have access to SQL?
no sir it is not online its on local host...its a windows application .i just needed to install it on my client machine..i think(not sure)..there might be something with the named instance or default instance....
SQL server on my machine supports ./sqlexpress but on client ./sqlexpress throws failure connectivity....
November 2, 2012 at 4:52 am
If its a windows application, being run as an exe by a logged in user, then the user who is running the exe needs to have access to the SQL server.
When I say is the database online, I mean is the server accessable from other machines and can you query the database from them.
From the machine where the exe is being run, can it ping the SQL server?
Do you have access to connect to the SQL server via RDP or SSMS?
Can you attach a screen shot of the SQL Server Configuration Manager from the SQL Server (PENTACLE-E8491F), not your local host.
November 2, 2012 at 4:59 am
anthony.green (11/2/2012)
If its a windows application, being run as an exe by a logged in user, then the user who is running the exe needs to have access to the SQL server.
When I say is the database online, I mean is the server accessable from other machines and can you query the database from them.
From the machine where the exe is being run, can it ping the SQL server?
Do you have access to connect to the SQL server via RDP or SSMS?
Can you attach a screen shot of the SQL Server Configuration Manager from the SQL Server (PENTACLE-E8491F), not your local host.
sir i m a beginner for sql server servicess so not sure abt ping,RDP,SSMS
below is the snapshot of sql server configuration manager...
November 2, 2012 at 5:25 am
This will hopefully help you in troubleshooting connectivity http://blogs.msdn.com/b/sql_protocols/archive/2008/04/30/steps-to-troubleshoot-connectivity-issues.aspx.
If the client cannot ping the machine by name then that is the reasoning behind it not connecting.
If it can ping the machine then there is something blocking communication between the client and the server, typically a firewall, this may or may not be the windows firewall, but also the network firewalls, check with your network administrators that there is no firewall stopping connectivity between client and server.
Ensure that the user who is logged on to the client has a login/user created in SQL and has access to the POS database.
November 2, 2012 at 9:41 am
As Anthony pointed out, this is a connectivity issues, not a SQL server security/login issue.
1. ping the name
2. ping the IP
3. Find out FOR SURE what port SQL server is listening on and telnet to <server_name>,<port>
4. make sure there are no aliases on the client box
Often it is a good test to try to connect to IP,port explicitly.
that way you have excluded a host of reason (DNS, etc.)
My favorite issue in instances like these is the alias with the trailing space in the name.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply