Deploying ASP.NET membership to Godaddy

烂漫一生 提交于 2019-12-08 06:54:22

问题


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.


回答1:


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.




回答2:


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?




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/974117/deploying-asp-net-membership-to-godaddy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!