I am working on an ASP.NET project. My database is SQL Server.
When I run the project against my local server, the connection is established. But as I put my project on GoDaddy Server and when I try to login, I found that no connection to SQL Server can be established. I am not able to login.
In both cases, I am working with an online database on GoDaddy.
Please help - is there some setting that has to be done on my hosting server?
Related
I used to just put my server name and my sql credentials to connect. Now, not connecting. My other domain login can connect to OTHER servers.
When I run the app in Development, it works. Localhost it does not. So, I know the server connection is good. Something with my networking, after I got a new computer.
I'm developing an ASP.net web application.
My default page is a simple login screen.
I am using Visual Studio to develop the application.
It will run using Visual Studio and when the data is entered to the text boxes and the button is clicked, it sends the request to my own server running Windows Server 2012 with SQL Server 2014 installed.
I will also mention that the ASP application is being created as a secondary application for an Android application. The Android application is using the same database over Internet connection so I know that the server and SQL server both can accept read and write calls.
I have tested the ASP application using WebClient calls to php files which connect to the database (this works on Android) and also OracleClient and SQLClient calls all of which work from Visual Studio on my workstation to the server machine. These all work fine to send and receive data from the database.
The problem is once I deploy the application to my hosting site the calls no longer seem to work. The default login page opens but after attempting to login I receive errors as follows:
Exception Details: System.ComponentModel.Win32Exception: No connection could be made because the target machine actively refused it
[Win32Exception (0x80004005): No connection could be made because the target machine actively refused it]
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.
Can anyone help me with this?
It sounds like your database is accepting connections from some clients, but not your hosting server. I would try testing a SQL connection straight from the hosting Server and see if a test connection can be successful. If you can get that to work it should work from the web server.
This article Quick ways to test OLE DB Connection String on creating a empty TestConnection.udl file will be helpful. It is easier to try different connection string settings through the Data Link Properties UI. When you save the file, you can see the connection string if you open it in a text editor (assuming it is successful).
If it's not a problem with he connection string, check that you do not have a firewall blocking connections between the Windows 2012 and SQL servers. It could be the widows firewall on either machine, or another firewall at the network level.
After publishing web application in IIS 6 I am getting follwoing error
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
It runs fine in development server with same DB connection
Please help me
there can be multiple issues with this. But basic problem is that web server is not able to locate DB server.
Try below steps to figure out the exact issue
is the DB server pingable from your web server?
are you providing correct user while connecting to SQL server.
are you able to connect to the DB server from web server using the username you provided in your config file?
try all above and let me know your result.
How would I go about connecting asp.net intranet pages with a remote mysql database? I have full access to both servers.
Usually, I connect my asp.net intranet pages, with a sql server which is in our own internal company network, I've never needed to connect to a remove mysql server before. However, I create php pages on our remote server all the time, which connect with a mysql server in the same network on which the php pages run.
UPDATE 1:
Forgot to mention that the asp.net pages are behind a firewall which only has ports http and ssh open.
You can connect using ADO.NET and the MySQL Connector available here:
http://www.mysql.com/products/connector/
There are also other alternatives here:
http://dev.mysql.com/tech-resources/articles/dotnet/index.html
EDIT: The firewall shouldn't be an issue as you're establishing an outbound connection (from the website to your database).
I'm developing a web site with asp.net on localhost, I'm beginner. I wrote a login page and it
works well. However when I click a link, the server can't load the page and gives this error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Any idea?
This means you either:
provided the wrong login/password for SQL while using SQL authentication
have used Windows authentication for SQL but the user that your web app is running as doesn't have a login
have provided the wrong connection details for the sql instance so it can't be found
don't have remote connections enabled for that SQL server instance
Are you using SQL server? If yes, run a debug and see what is the connection string at run time and whether you can connect to the DB using the connection string.
In case you are not using SQL server, it seems, you have extended the membership provider but not done so for the role provider. The default role provider tries to connect to SQL Server instance.