I now know that the .mdf file (I don't have a .ldf file for some reason, does this not come with the latest download of the TimeTracker starter-kit?) must stay in the app_data directory. But, I have SQL Server 2005 and so the connection strings in the default
WEB.CONFIG file are for SQL Express
This is a correct connection string if the SQL Database is on the server, If the SQL Database is on another server you can point it out with server=COMPUTERNAME\SQLExpress
If you have another instance name of the database you can change it to..
I have a similar issue and was wondering if you resolved what needed changing in the config file when moving it Sql Server 2005, I get the following error when attempting to login. This instance is setup to allow remote connections and is happily running
other applications so I think this generic error is not really telling the story. I suspect the issue is with the default Express version of the Web.config and I am not experienced enough at the moment to determine what, so my getting started experience has
come to an abrupt stop.
Server Error in '/' Application.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces,
error: 26 - Error Locating Server/Instance Specified)
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server
does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I have a similar problem. I have everything working locally and have copied a published version to a hosting server from GoDaddy. I get an error similar to the one above
How do I change these to work with SQL Server 2005?
Hi,
When using this starter kit with Sql Server 2005, this worked for me.
BTW, if you get the error about not finding the stored proc / something to do with creating the schema, follow the advice in some of the posts about the aspnet_regsql.exe - it worked for me!!
Tryst
Participant
915 Points
364 Posts
Connection string in WEB.CONFIG for SQL Server 2005
Jul 13, 2006 10:33 PM|LINK
I now know that the .mdf file (I don't have a .ldf file for some reason, does this not come with the latest download of the TimeTracker starter-kit?) must stay in the app_data directory. But, I have SQL Server 2005 and so the connection strings in the default WEB.CONFIG file are for SQL Express
<connectionStrings>
<add name="aspnet_staterKits_TimeTracker" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=true" />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=true" />
</connectionStrings>
How do I change these to work with SQL Server 2005?
Hope you can help.
Thanks
Tryst
Evolver
Member
10 Points
2 Posts
Re: Connection string in WEB.CONFIG for SQL Server 2005
Jul 18, 2006 02:14 PM|LINK
This is a correct connection string if the SQL Database is on the server, If the SQL Database is on another server you can point it out with server=COMPUTERNAME\SQLExpress
If you have another instance name of the database you can change it to..
<
add name="aspnet_staterKits_TimeTracker" connectionString="server=.\SQLExpress;uid=timetraxuser;pwd=timetraxpassword;database=timetrax"/><
remove name="LocalSqlServer"/><
add name="LocalSqlServer" connectionString="server=.\SQLExpress;uid=timetraxuser;pwd=timetraxpassword;database=timetrax"/>/Jonas
kimmeyer
Member
33 Points
13 Posts
Re: Connection string in WEB.CONFIG for SQL Server 2005
Oct 05, 2006 12:01 PM|LINK
Hi,
I have a similar issue and was wondering if you resolved what needed changing in the config file when moving it Sql Server 2005, I get the following error when attempting to login. This instance is setup to allow remote connections and is happily running other applications so I think this generic error is not really telling the story. I suspect the issue is with the default Express version of the Web.config and I am not experienced enough at the moment to determine what, so my getting started experience has come to an abrupt stop.
Server Error in '/' Application.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Thanks
Kim
chetan.sarod...
All-Star
65729 Points
11138 Posts
Re: Connection string in WEB.CONFIG for SQL Server 2005
Apr 25, 2007 04:13 AM|LINK
Open "SQL Server Surface Area Configuration"
then opne the "Surface Area Configuartion for Services and Connections "
Under the Remote connection u have to enable the "Using both TCP/IP and Named Pipes "
then It will work..
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
edba1970
Member
6 Points
20 Posts
Re: Connection string in WEB.CONFIG for SQL Server 2005
Nov 29, 2007 11:58 PM|LINK
I have a similar problem. I have everything working locally and have copied a published version to a hosting server from GoDaddy. I get an error similar to the one above
... (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I was looking on line and tried some suggestions but none worked. Here's what I have under my web.config file:
<connectionStrings> <add name="vsItemsConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\vsItems.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings>Then I have added the following lines under <system.web> which I copied from the website as the suggestion:
I still get the same error. By the way I am using SQL Express which is built-in to .NET
Any idea how to go about fixing this? Any help would be appreciated.
Thank you.
chetan.sarod...
All-Star
65729 Points
11138 Posts
Re: Connection string in WEB.CONFIG for SQL Server 2005
Nov 30, 2007 02:34 AM|LINK
Try to set Data Source= "serverName" in you connectionString
Data Source=.\SQLEXPRESS will work only on local m/c, It will not work if you host your site
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
aspnewbieper...
Member
466 Points
245 Posts
Re: Connection string in WEB.CONFIG for SQL Server 2005
Feb 11, 2008 09:49 AM|LINK
Hi,
When using this starter kit with Sql Server 2005, this worked for me.
BTW, if you get the error about not finding the stored proc / something to do with creating the schema, follow the advice in some of the posts about the aspnet_regsql.exe - it worked for me!!
Hope this helps.
Cheers
chetan.sarod...
All-Star
65729 Points
11138 Posts
Re: Connection string in WEB.CONFIG for SQL Server 2005
Feb 12, 2008 02:27 AM|LINK
Set Try to set Data Source = "Server name" in connection string
Open "SQL Server Surface Area Configuration"
then opne the "Surface Area Configuartion for Services and Connections "
Under the Remote connection u have to enable the "Using both TCP/IP and Named Pipes "
then It will work..
Try to set Data Source= "serverName" in you connectionString
Data Source=.\SQLEXPRESS will work only on local m/c, It will not work if you host your site
Check in web.config for connectionString, configure it according to your server name, password etc.
In Time Tracking System, it uses inbuild Membership classes for user creation, updation etc..
You have to register your DB with ASP.NET Membership classes by executing the command line utility in VS prompt
aspnet_regsql, it will open one window, where you have to configure DB.
Hope it will help you, let me know.
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
chetan.sarod...
All-Star
65729 Points
11138 Posts
Re: Connection string in WEB.CONFIG for SQL Server 2005
Feb 13, 2008 02:26 AM|LINK
Have you tried my solution
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
chetan.sarod...
All-Star
65729 Points
11138 Posts
Re: Connection string in WEB.CONFIG for SQL Server 2005
Feb 19, 2008 02:22 AM|LINK
What is the status of your post
Have you solved your problem
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.