今天我创建了两个页面 login.aspx 使用 LOGin 控件和 register.aspx 使用创建用户向导...
当我在本地计算机中使用生产服务器的连接字符串时,只有当我的数据库 ASPNETDB.MDF 存在于我的本地计算机的 APP_Data 文件夹中时,站点才有效。
如果我重命名 ASPNETDB.MDF 或从我的本地计算机 App_Data 中删除 ASPNETDB.MDF,则会发生以下错误...
An attempt to attach an auto-named database for file C:\Users\Ashish Dobriyal\Documents\Visual Studio 2008\WebSites\VOLVOO\App_Data\ASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
但
在我将我的网页......和数据库发布到我的生产服务器后......它会产生一个错误......
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)
究竟是什么问题... ??
我的生产服务器连接字符串:
<connectionStrings>
<remove name="ConnectionString"/>
<add name="ConnectionString" connectionString="workstation id=volvobusesindia.mssql.somee.com;packet size=4096;user id=username;pwd=password;data source=dobriyal.mssql.somee.com;persist security info=False;initial catalog=dobriyal" providerName="System.Data.SqlClient"/>
</connectionStrings>
我的本地服务器连接字符串:
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>