Hi guys,
I am getting this SQL error when I try to login after deploying my website to our local intranet server:
An error has occurred while establishing a connection tothe server. When connecting to SQL Server 2005, this failure may becaused by the fact that under the default settings SQL Server does notallow remote connections. (provider: SQL Network Interfaces, error: 26- Error Locating Server/Instance Specified)
It is definatelly the login because if i access the default.aspx directly it and the rest of the sign works perfectly. I am using form authentication because i am using a login view for a status feature that i have added.
Any suggestions will be greatly appreciated because i am stumped!
Hi,
From the error it seems that you are not able to connect to the SQL Server which I believe is on a remote machine. So First can you try to connect to the SQL Server from either SQL Query Analyser or Enterprise Manager from a different machine. If That works fine check your connection string that you are using to connect to the Server. There might be something missing
Hope this helps to solve your problem
Good Luck
Regards
Vineed
You have to allow remote TCP connection from sql server surface area configuration
Check my this post http://forums.asp.net/t/1176200.aspx?PageIndex=2
I am deploying the site to a local server for our intranet. The database that I am connecting to is the same one I connect to for the rest of my site which works fine with their connection strings. I think the problem has got something to do with my login. I am using the configuration wizard to setup my users and rolls and it automatically created a database in App_data called ASPNETDB. This whole setup works perfectly in my development enviroment on my machine but as soon as i deploy it i get the above error. Here is my web.config file:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<customErrors defaultRedirect="~/Error.aspx"/>
<authorization>
<allow roles="Administrator"/>
</authorization>
<roleManager enabled="true"/>
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms">
<forms loginUrl="Login.aspx" defaultUrl="Default.aspx" slidingExpiration="true" timeout="30" cookieless="UseCookies" name="OMSCookie" path="/Stuff" requireSSL="false" enableCrossAppRedirects="false" protection="All">
</forms>
</authentication>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
Is there anything that needs to be configured on the server for my site to work. I have been doing some investingation and some of the websites i have checked out seem to use memebership. I dont know how important this is as this is my first time adding a login feature to one of my sites.
Thanks
Bryan
Are you using Membership features available in .NET 2.0? Have you created all the aspnet_[TableName] on your production environment?
Hi,
Since the database is local to the system i have copied it with my deployment. As for membership I dont know. I havent explicitly used any membership contols ( or even membership at all for that matter) so I dont really know.
Bryan
first check if sql is turned on.
second visit the sql server surface area configuration and enable the tcp ip.
the sql server is the same machine that iis? if not unblock port 1433 of the windows firewall.
Yip, it is turned on.
What i have recently found out is that the server that i am deploying the site to does not have sql server on it. I want to move the local database to the database server and change the references in the site to point to this new database instance when a user logs in. Is this possible?
Thanks
Bryan
so let me see... you want to login to a database and then work in another database... am i correct?
if so you just need to have two connectionStrings one for each database...
Hello,
The solution was: mounted the default sql serverdatabase (ASPNETDB) on our database server and added a connectionstring in the webconfig to point to it. what i had to do was remove theconnection string and then recreate it as follows
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="DataSource=CORE;Initial Catalog=ASPNETDB;Persist Security Info=True;UserID=user;Password=password" providerName="System.Data.SqlClient"/>
this sorted out all my issues.
Thanks
Bryan
0 comments:
Post a Comment