Deploying ASP.NET membership to Godaddy
Asked Answered
M

4

1

I'm trying to deploy a website using ASP.NET membership and the hosting company is godaddy. Problem is that for some reason an error is being thrown when I log in. I've modified some pages for testing purposes to see if I can pull data from the database and it works fine. So I know it's mapping to the proper source. The error I'm receiving is the following:

"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 help would be much appreciated.

Marylandmarylee answered 10/6, 2009 at 7:21 Comment(0)
J
0

It sounds like something is using the LocalSqlServer automagic connection string still. I'd add<remove name="LocalSqlServer /> to your <connectionStrings> and see what blows up.

Jolty answered 10/6, 2009 at 21:17 Comment(3)
I added <remove name="LocalSqlServer"> to my web.config and the following error message showed up: "The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty." Judging from the error message I don't think there is a "LocalSqlServer" connection anywhere in my app.Marylandmarylee
Ok, that is good. Another thing you could do is have the providers spit out their connection info to a screen for debugging purposes. That might show you what is happening.Jolty
Sounds more like there is something in your app that is actually trying to use "LocalSqlServer", but you get the error since you removed that connection now.Bema
U
0

When you setup membership it normally adds another connection string to your web.config. I think it creates a key in the web.config called ApplicationServices that contains the connection string that the membership classes will use (I think this depends on what membership provider you are using). When you checked the connectionstring did you also check that one?

Underpass answered 10/6, 2009 at 7:26 Comment(1)
I checked my web.config file for "ApplicationServices" but couldn't find it. The web.config shows only the one connecting string I created.Marylandmarylee
T
0

When you use membership asp.net creates a SQL Database called ASPNETDB.MDF in the App_Data folder which you will need to ensure is set up correctly on the host as you would have done with your main database.

You'll also need to amend the additional connection string in your web.config file so that it points to this database.

Turro answered 10/6, 2009 at 7:40 Comment(4)
When I created my database I used SQL Server Management studio to generate a query that would create all the tables and stored procedure in the ASPNETDB.MDF file. I then took that query/sql code and used it to append to my current database. Not sure if that makes any big difference or not. Sorry if I'm being unclear I'm still a noob to the .NET world.Marylandmarylee
So are you saying that you are just using the one database - ASPNETDB.MDF - which contains the asp.net membership etc.. tables and your own tables ? What does your connection string to the database look like ?Turro
<add name="ConnectionName" connectionString="Data Source=SourceLocation; Initial Catalog=DatabaseName; User ID=UserID; Password=Password;" providerName="System.Data.SqlClient"/> I basically took everything from the default membership database and added to my current database.Marylandmarylee
I'm not totally sure but you may need to add another connection string with a name of "LocalSqlServer" pointing to the same database which would tell asp.net where to look for the membership details.Turro
B
0

Membership settings in web.config can be configured to use any connection string that is defined in web.config. If your membership tables are in the same database as the rest of your tables, I imagine you shpould be able to use a single connection string for everything. That is what I have been trying to set up on my own GoDaddy-hosted website lately, and that is what reading MSDN's documentation suggests should be possible. The "membership" section of "system.web" has a "providers" section, and "add" for that section has a "connectionStringName" attribute.

Bema answered 10/6, 2009 at 21:13 Comment(2)
I added all of that to my web.config but still no luck. Would you happen to have any links that could walk me through setting up membership on GoDaddy hosting?Marylandmarylee
No, but I do have membership working on my GoDaddy website now. The difference, however, is that I am not using their default database to hold the membership information. I installed the ASP Schemas into my primary database instead.Bema
J
0

It sounds like something is using the LocalSqlServer automagic connection string still. I'd add<remove name="LocalSqlServer /> to your <connectionStrings> and see what blows up.

Jolty answered 10/6, 2009 at 21:17 Comment(3)
I added <remove name="LocalSqlServer"> to my web.config and the following error message showed up: "The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty." Judging from the error message I don't think there is a "LocalSqlServer" connection anywhere in my app.Marylandmarylee
Ok, that is good. Another thing you could do is have the providers spit out their connection info to a screen for debugging purposes. That might show you what is happening.Jolty
Sounds more like there is something in your app that is actually trying to use "LocalSqlServer", but you get the error since you removed that connection now.Bema

© 2022 - 2024 — McMap. All rights reserved.