.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Connection string to connect with Sql Server 2008.

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net


May  be it's a wrong place to ask the following question. Sorry for that. Our hosting provider has recently upgraded their database server from Sql Server 2005 to 2008 and I'm getting errors to connect with remote server from my development machine. Error Message "Invalid connection". Tried to find solution on net but couldn't find it.

I'm using .Net 1.1. Though we've updated versions 2.0,3.5 & 4.0 but due to some certain circumstances I've no way to update it. It's a web based project. The following connection string works fine for Sql Server 2000 & 2005 but not for 2008.

<add key="ConnectionString" value="Data Source=Remote Server's domain name;Initial Catalog=database name;User ID=user name;Password=surround;Persist Security Info=True;Pooling=false;Connect Timeout=45;" />


Remote Server's domain name indicates to remote db server like: test.mysite4now.com

database name for example: test_surround

user name like test_surround

password: surround.

Can anyone inform me what's wrong with the above connection string to connect to Sql Server 2008.



View Complete Post

More Related Resource Links

web.config connection string problem within VisualStudio 2010 to point to SQL Server 2008 R2 Develop


Hello All, I would appreciate any help with this.

I believe my problem exists within the web.config which already had code in it to connect to SQL Server Express 2008.

I uninstalled the SQL Server Express that came with Visual Studio 2010.

I installed SQL Server 2010 R2 Developer, and I'm able to connect via Management Studio and through Visual Studio's Server Explorer's Data Connections I am connected.

I did run aspnet_regsql.exe within the 4.0 folder in order to create the database with Microsoft Service Providers.

Here is the ServerName: USER-5529234649 

Here is the name of the DataBase:  StepByStepChapter9

Here is the name of the Connection within Visual Studio's Server Explorer's Data Connections:  user-5529234649.StepByStepChapter9.dbo

Here is the code I changed in the web.config:

<add name="ApplicationServices" c

Cannot connect to SQL Server 2008 RS Express, only connection to SQL Server 2008 Express succeeds?


Hi all,

my experience with SQL Server tends to zero. I've recently installed the new SQL Server 2008 RS Express with Advanced Services on my VISTA-machine because this version is prerequisite for installing some sample databases. There already existed a simple version of SQL Server 2008 express installed together with an older Visual Studio Express version. I thought that one would be upgraded but in fact the setup program installed the new 2008 RS version side-by-side to the older version.

The SQL Server ConfigManager shows actually both servers as running. SQL Server 2008 express named as "SQLEXPRESS" (Vers. 10.0.2531.0; path: '...\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Binn\') and the newer SQL Server 2008 RS express as "MSSQLSERVER" (Ver. 10.50.1600.1; path: '...\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\'). But MS SQL Server Management Studio only lets me connect to the older SQLEXPRESS-Server, the new "MSSQLSERVER" doesn't even show in the "Connect-to-Server"-dialog.

What went wrong? I'd appreciate any help,


How to connect to local instance of SQL Server 2008 Management Studio Express ?


I just installed SQL Server 2008 Management studio Express on my Vista machine.

i tried connecting to local machine using :

.\sqlexpress, (local)\sqlexpress, or .\SQLExpress, MyPCNAME\SQLExpress

nothing is working, getting this error:

Cannot connect to PC-NAME\SQLEXPRESS. 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)

Connection to SQL server 2008 fails randomly

I'm sure a lot of you have seen this error: "A network-related or instance-specific error occurred while establishing a connection to SQL Server" Normally I would assume that this would mean that there's a problem connecting to the SQL server, but currently I'm having a hard time figuring out what the problem is and how to fix it The problem only occours randomly, but mostly it is when I from the same computer calls the server several times for example like this: For i as integer = 0 to 500 OpenConnectionToSqlServer(Bla bla) ReadData() CloseConnection() next I always makes sure to close the connection again. The more often I connect to SQL server in a row, the higher is the percentage of errors I have created my code so that if the above error happens, the program will wait for a second, then try again (after 3rd try it will stop trying)   I have several times been monitoring the SQL server at the same time, but I can't seem to see anything from there :(

Connection to Exchange Server of .NET 1.1 Framework application on Windows 2008 64-bit

I am running Visual Studio 2003 .NET Framework 1.1 application on Windows 2008 64-bit machine. There is only one problem - connection to Exchange Server. The same application is running fine on Windows 7 64-bit machine (not server). I tried to use the same Interop.MAPI.dll I used for Windows 7, but it doesn't work for Windows 2008.   Please help.  

Remote Connection to SQL Server 2008

Hi everyone,    I'm allowing remote connections, have started the SQL Server Browser, and have the TCP/IP protocol enabled for my server instance, but I still can't connect to my SQL server remotely.   I have my router forwarding to the local IP for it when using port 1433 and it works when I put the router ip with 1433 locally, but it gives me an error when I try this remotely. It throws a timeout error, so it isn't even reaching it.   Any suggestions?

Can not connect to user instance of SQL Server 2008 Express with Advance Services in Visual Studio 2

I used SQL Server 2008 Express with Advanced Services (not SQL Server 2008 Express) in Visual Studio 2010 because it is the fast and easy way to developed and managed data-driven applications with powerful built-in reporting and full-text search functionality. I received Sql Server 2008 Service Pack 1 with Windows Update. It's ok if I connect to instance of SQL Server 2008 Express with Advance Services (with SP1) through SQL Server Management, but if I try to attach a database in Server Explorer (Visual Studio 2010), I get the following error: "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed." I'm stuck at this point. Is there a fix or a workaround? I've already tried deleting the 'C:\Users\Administrtor\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS' directory as mentioned in other posts, with no luck. The error.log at 'C:\Users\Administrator\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS\error.log' has the following relevant entries: 2010-09-01 14:44:10.47 Server      Error: 17156, Severity: 16, State: 1. 2010-09-01 14:44:10.47 Server      initeventlog: Could not initiate the EventLog Service for the key '3677F6D3-17C7-4F', last error code is 2. 2010-09-01 14:44:10.47 Server &

how many open connection is recommended to leave - in sql server 2008 Enterprise Edition

hi i have my C# program that work with sql-server 2008 Enterprise Edition i have 40 users that connect to this database. i dont close the connection. how many open connection is recommended to leave ? or is it better to close connection ? thank's in advance

Unable to connect SQL Server 2008

Hi, I have recently installed a trial copy of SQL Server 2008 from MS web but I am not able to connect to the SQL Database Engine locally using Windows Authentication. Whenever, I tried I got the following error message: "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) (Microsoft SQL Server, Error: 53)" Just to inform you, I have OS Win7.  And I want to establish local connections only on my laptop.

Connect to SQL Server 2008 Express

Hi Guys, I have just started a personal project for our Corporate Desktop environment to actively track our Hardware and Software Inventory.  My plan is this for starters:   1 Computer using VBScript and WMI to gather the data, store the data into SQL Server 2008 Express, and present the data using ASP.NET or Javascript. The VBScript will get a list of computers from AD under specified OUs and will run on a scheduled task.   This deployment will initially be on 1 desktop computer for now.  How do I connect to SQL Server 2008 locally using OLEDB from my vbscript?  Will this require a username/password even though it is a local connection?  If it does require a password, do you know a way to prevent the password from being stored as clear text.  Does Windows Integrated configuration on the SQL Server 2008 Express allow a passthrough of credentials from the Scheduled Task so that the password is not required from the script?  I would like it to be as secure as possible since we have financial services users and we would be under the scope of an audit if ever it was needed or requested.  Thanks guys.  :-)

Cannot Connect SQLServer 2008 with the provider SQLNCLI... Is there any SQL Server 2008 patch to sup

We have a program which developed under SQL Server 2005. In the program the provider of the connect string is hard coded as "SQLNCLI". It's ok running on SQL Server 2005. Now, for some reasons, this program must run under SQL Server 2008 (x64). But our program cannot access the SQL Server. We check the reason, found that, in SQL Server 2008, SQLNCLI is changed to SQLNCLI10, this caused our program cannot run. So I want to ask, is there any patch of SQL2008, so that the legacy program can normal access SQLserver with SQLNCLI WITHOUT rebuild a new version?  

Error Message: The attempt to connect to the report server failed. Check your connection informatio

I have a web page that contains a ReportViewer control.  I am trying to display a report, which is an .rdl file located on the SSRS server, in this ReportViewer control.  I have set the ReportPath and ReportServerUrl correctly.  I am getting an error message. Am I suppose to use an .rdlc file rather than a .rdl file?  Does the web server configuration need to use a certain account?  I am getting the following error message: The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version. The request failed with HTTP status 404: Not Found.

Can't connect to SQL Server 2008 Reporting Services

When attempting to connect to SQL Server 2008 (evaluation) on Windows XP SP3, using the following url, http://servername:8080/ReportServer I receive a popup dialog box asking me for a user name and password to connect to the server.  When I enter the domain\user and password that I think it should be, it pops up two more times and then displays a blank internet explorer web page.  It is a fresh install and I believe I have everything running correctly.   Any input or guidance would be extremely appreciated.   Thank you in advance.

How to connect visual web developer 2008 express edition to SQL server 2008 ??

i know its a basic question guys! please help me . i have created a login.aspx file in visual web developer .now i want to connect the username and password details to SQL database ... How do i do it .....I can see some grt genius out there, i am sure some one is kind enough to help me with this question !!! thank you .....................................

SSRS 2008 - report manager: System.Net.WebException: Unable to connect to the remote server

I have an instance of Reporting Services 2008 running on Windows 2003 server.  So, the webservice URL is running on port 801, and runs fine (I can browse reports from that directory, and upload / deploy new reports and overwrite existing reports. Report manager is set to use port 800 (IIS is also on that machine running port 80).  When I attempt to connect to report manager, I get the following error, with a link to "Home" in report manager (which brings me back to the existing error page):    Unable to connect to the remote server  In the logfiles for reporting services, the following error is there: " System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it.   Any ideas? Windows Firewall is NOT running on this machine.   Thanks, Chrisrjp

Cannont connect to New Installation of SQL SERVER 2008 from New Vista Ultimate machine(s)

I have a new SQL Server 2008 Development edition installation on a Newly setup Server running Windows Server 2008 Enterprise edition.  The server is mainly a file server and is not setup as a domain controller.  Since my test environment is fairly basic (server and two Vista Ultimate machines) I thought the connection through data sources on the client machines would be straight forward.  But it isn't working.  I can see the server, ping the server, etc. but when I try and connect the client through a system DNS it will not connect using SQL Server authentication using a loginId.  (since it isn't on a domain, I can't use Windows NT Authentication).   The error is SQL Error 10060 and SQL Error 17.  (connection failed and SQL Server does not exist or access denied)  Any thoughts or suggestions are appreciated. WB

Can't Connect to Sql server studio 2008

Hello,   I installed the Sql Server Management Studio 2008 and made a connection but last week when i tried to connect got the error below............   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) (.Net SqlClient Data Provider)   I haven't changed anything.  I was also unsuccessful in starting the sql agent in sql configuration.  Thanks,        
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend