Saturday, February 25, 2012

Application Login SQL Error

I created aASP.net 2.0 application usingC# on VS2005
The application access several database on a remoteSQL Server 2005

I recently added Login functionalties to the application, this created a MDF in the app_data folder.

Everything works fine on my local desk top...

I can access my remote SQL Server 2005

and the local MDF file works fine, I can create account, login and all that fun stuff

So I Published the site to my target server:

Which is the same server running the SQL Server 2005

The parts of the application that does not require login works fine, I can access the SQL server 2005 with ease..see data, update, everything

However when ever I try to login or create an account from the application(MDF file) I get this:

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 can only assume that the problem is with the MDF file.

Can anyone point me in the right direction?

Thank you
Andre

This is often fixed by ensuring the Initial Catalog entry is in the connectionstring.

.....Initial Catalog=yourFileWithoutTheExt....

I just reread the error...actually, I think it's because you are trying to administer the DB from your PC, and it's not setup that way.

|||

Thank you for responding,

On my target server I do not have SQL Express but SQL server 2005 and the remote setting for that is correct.

I changed my application from using the local SQL Express MDF file to use the SQL server 2005 for membership and roles by running aspnet_sql.exe to set up the database.

And all is working.

Thanks again

Andre

No comments:

Post a Comment