C# ASP:想主持我的项目吗
我在ASP.NET中有一个项目。我想把它放在互联网上,为此我上传了所有的文件和我的数据库。 但当我尝试登录时,它会显示如下错误 我的web.config文件中没有任何更改。就像在我的web.cofig文件中一样,我的服务器名是AMIT-PC 当我添加inside system.web时,它得到了如下错误 这是我的连接字符串 我应该换吗 我的整个web.configC# ASP:想主持我的项目吗,c#,asp.net,web-hosting,C#,Asp.net,Web Hosting,我在ASP.NET中有一个项目。我想把它放在互联网上,为此我上传了所有的文件和我的数据库。 但当我尝试登录时,它会显示如下错误 我的web.config文件中没有任何更改。就像在我的web.cofig文件中一样,我的服务器名是AMIT-PC 当我添加inside system.web时,它得到了如下错误 这是我的连接字符串 我应该换吗 我的整个web.config <configuration> <connectionStrings> <add name
<configuration>
<connectionStrings>
<add name="connect" connectionString="server=AMIT-PC;database=OnlineLibrary;uid=sa;pwd=12345"/>
</connectionStrings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.SqlServer.Smo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
<add assembly="Microsoft.SqlServer.SmoExtended, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
<add assembly="Microsoft.SqlServer.ConnectionInfo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
<add assembly="Microsoft.SqlServer.ConnectionInfoExtended, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
<add assembly="Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5"/>
<authentication mode="Forms">
<forms loginUrl="~/PageUser/login.aspx" timeout="2880"/>
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="connect" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="connect" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="true">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="connect" applicationName="/"/>
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
</providers>
</roleManager>
</system.web>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
</appSettings>
</configuration>
您的sql凭据在某些地方出错。您将得到下面的错误 您的凭据错误或存在以下问题 如果sql server configuration manager中允许,请检查管理管道tcpip etc配置 [Win32Exception 0x80004005:用户名或密码不正确]
[SqlException 0x80131904:建立与SQL Server的连接时发生与网络相关或特定于实例的错误。找不到或无法访问该服务器。请验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。提供程序:命名管道提供程序,错误:40-无法打开连接n到SQL Server]您必须在哪个文件夹中上载文件..您必须找出错误所在。正如此错误消息所示,请将该行添加到web.config中配置部分的system.web子部分,以查看错误消息是什么。这实际上不属于SO..但登录页对我来说运行正常。看起来您的数据库是credenTIAL错误。连接字符串中的uid和pwd属于我的sqlserver。