How To Connect To Remote Server IP Using MSSQL2005? - asp.net

I have a following details provided by our mssql2005 database provider
Server IP : 100.20.255.34
Databaase name : insss
User: nas0
password : ymkv45SEv
i have the following connectionstring in my web.config file in my offline site as :
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
I want
how to edit my web.config connection string mentioned above using the details provided above so that it connect to my MSSQl2005 hosting provider .... ?
I don't know how to edit connection string to do that !!
When i run my site www.vbi.volvobusesindia.com then the following error occurs in top of the page ...
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

This should work just fine:
<add name="ConnectionString" connectionString="Data Source=100.20.255.34;Initial Catalog=insss;User ID=nas0;Password=ymkv45SEv;Integrated Security=False" providerName="System.Data.SqlClient"/>

Related

Error in SQL server connection

I have an ASP.net website and I have uploaded it on a free hosting site. I have uploaded all files and directories. Changed the connection string with the connection string given by the hosting site. But still I am receiving this error. Error message is:
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: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified)
http://opacpsu-001-site1.smarterasp.net/psu-home1.aspx
Here is the connection string give by the hosting site.
"Data Source=SQL5013.Smarterasp.net;Initial Catalog=DB_9B4835_OPAC;User Id=DB_9B4835_OPAC_admin;Password=12345678;"
What should I do?
Okay so I forgot to show the configuration in the Web.config file.
Here it is.
<connectionStrings>
<add name="OPACConnectionString" connectionString="Data Source=SQL5013.Smarterasp.net;Initial Catalog=DB_9B4835_OPAC;User Id=DB_9B4835_OPAC_admin;Password=12345678;" providerName="System.Data.SqlClient" />
</connectionStrings>

how to access database kept in App_Data folder

I am getting problem while I try to access MS-SQL database that is kept in "App_Data" folder.
My connection string in web.config file is-
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\CRMDb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
The Exception is-
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: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified)
Any relevant help would be highly appreciated.
Thanks in advance
First things first: do you have SQL Express installed on your machine? If not you can get it here for free.
If you do have SQL Express installed, check if your SQL Express instance is running. If it's not running, open a command prompt (as Administrator) and execute the following command:
net start mssql$sqlexpress

not able to registered user on sql membership on server?

I have successfully hosted my mvc website on server.
But I'm not able to registered new user.
I have used following connection string.
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>
Error is
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Using SQL membership tables for create user .
All going good on localhost but after hosting getting error.
Where I go wrong?
Sound like the aspnetdb.mdf file is not in the Data folder on the host can you confirm the App_Data directory and aspnetdb.mdf file exists on the host?
On remote server you need to change your connection string. Please user correct server url/ip and db name

unable to connect asp.net application with godaddy.com sql server database

I have domain on the godaddy.com. I have create the database over there.I am able to connect to the database from godaddy.com site with specified user name and password. but when i am going to use same information in my connection string in my asp.net web application on local machine it is showing
"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)"
This error.
my connectionstring is :
<add name="MyConnectionString"
connectionString="Data Source=myDataSource; Initial Catalog=MyDatabaseName; User ID=MyUserId; Password=MyPassword" providerName="System.Data.SqlClient" />
I have provided all required parameters to connection string here.I got this parameter information from godaddy.com database Description section.
You can't do that, their SQL server don't accept external connections.
[EDIT] OK, it seems that my first sentence is incorrect, look here:
http://community.godaddy.com/help/article/4978
http://community.godaddy.com/groups/web-hosting/forum/topic/ms-sql-remote-access/
http://help.godaddy.com/article/4977

A network-related or instance-specific error occurred while establishing a connection to SQL Server

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
when i upload my site on webserver and connect with remote sqlserver2005 using connection string....
<connectionStrings>
<remove name="ConnectionString"/>
<add name="ConnectionString" connectionString="Data Source=69.16.253.19,1433;Initial Catalog=vb_usa;Persist Security Info=True;User ID=username;Password=password" providerName="System.Data.SqlClient"/>
</connectionStrings>
it produces the following errr --
you can see error in my webpage :
http://vbi.volvobusesindia.com
it shows an error above ..
i m using aspnetdb.mdf in my website in APP_Data Folder... features i use in my website is Login Control, Password recovery, signup control...
Tried all the above but did not work for me. When I checked Services, I found that the SQLExpress service which was set Automatic, was not started. Once I started the SQLExpress service, everything worked.
See the guide in this site http://www.connectionstrings.com/sql-server-2005
In particular look at the section on that page titled "Attach a database file, located in the data directory, on connect to a local SQL Server Express instance"
The format is:
Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf;
Database=dbname;Trusted_Connection=Yes;
Basically, you need to connect to the SQL Express instance installed on the web server and point it to where your database file is located.
On that remote machine (63.15.223.19), the SQL services are not running. You can go to that machine and try to run "net start mssqlserver" from command prompt.

Resources