I have designed an application that runs perfectly fine locally using VS 2008. However, when I load the site and run it on the web I get the following error: The site is configured for Forms Authentication so I am very confused here. Any help would be appreciated. Here is my web.config Code: <?xml version="1.0"?> <configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> </sectionGroup> </sectionGroup> </sectionGroup> </configSections> <connectionStrings> <clear/> <remove name="LocalSqlServer"/> <add name="LocalSqlServer" connectionString="Data Source=tcp:sql.discountasp.net;Initial Catalog=SQL2008_721444_pep;User ID=SQL2008_721444_pep_user;Password=XXXXXX" providerName="System.Data.SqlClient"/> <add name="MYSITEConnectionString1" connectionString="Data Source=tcp:sql2k803.discountasp.net;Initial Catalog=SQL2008_MYSITE_user;User ID=SQL2008_721444__pep_user;Password=XXXXXX; Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient"/> <add name="ASPNETDBConnectionString1" connectionString="Data Source=tcp:sql2k803.discountasp.net;Initial Catalog=SQL2008_721444_aspnetdb;User ID=SQL2008_721444_aspnetdb_user;Password=XXXXX;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings> <location path="style.css"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> <system.web> <customErrors defaultRedirect=""/> <profile enabled="true"> <properties> <add name="FirstName" type="string"/> <add name="LastName" type="string"/> <add name="SearchTerms" type="System.Collections.Specialized.StringCollection" serializeAs="Xml"/> </properties> </profile> <roleManager enabled="true" defaultProvider="SqlRoleManager"> <providers> <add name="SqlRoleManager" type="System.Web.Security.SqlRoleProvider" connectionStringName="ASPNETDBConnectionString1" applicationName="MYSITE" /> </providers> </roleManager> <authorization> <allow roles="Administrator"/> <deny users="?"/> </authorization> <membership defaultProvider="MyMembershipProvider" userIsOnlineTimeWindow="30"> <providers> <clear/> <add name="MyMembershipProvider" connectionStringName="ASPNETDBConnectionString1" applicationName="MYSITE" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" minRequiredPasswordLength="3" minRequiredNonalphanumericCharacters="0" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> </providers> </membership> <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-CA"/> <compilation debug="true" strict="false" explicit="true"> <assemblies> ........ </assemblies> </compilation> <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" timeout="30" name=".ASPXAUTH" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="Home.aspx" cookieless="UseDeviceProfile" enableCrossAppRedirects="false" /> </authentication> <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> <pages maintainScrollPositionOnPostBack="true"> <namespaces> <clear/> ...................... </namespaces> <controls> .......................................... </controls> </pages> <httpHandlers> ...................... </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </httpModules> </system.web> <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <providerOption name="CompilerVersion" value="v3.5"/> <providerOption name="WarnAsError" value="false"/> </compiler> <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <providerOption name="CompilerVersion" value="v3.5"/> <providerOption name="OptionInfer" value="true"/> <providerOption name="WarnAsError" value="false"/> </compiler> </compilers> </system.codedom> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <remove name="ScriptModule"/> <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </modules> <handlers> <remove name="WebServiceHandlerFactory-Integrated"/> <remove name="ScriptHandlerFactory"/> <remove name="ScriptHandlerFactoryAppServices"/> <remove name="ScriptResource"/> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </handlers> </system.webServer> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
I have not gone over your entire web.config file but your LocalSqlServer server declaration looks incorrect to me: I think you want sql2k803.discountasp.net instead of sql.discountasp.net
Duh! Thank you so much ... I have inherited a new error however Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion' ... researching now but if you have any suggstions much appreciated
ASP.NET Membership/Roles is probably not installed in your database. Please review the following KB article: http://support.discountasp.net/KB/a...rshiproles-provider-to.aspx?KBSearchID=260894
I fixed the problem. The connection string to the ASPNETDB is working - the one with the members and roles no problems. However, I am struggling to get into any of my pages that are connected to the websites database. (The second connection string). Do I need to clear it as well? Thank you in advance!
So I tried adding a second Remove Name with the second part of the connection string and that did not work. Any suggestions?
Try taking out User Instance=True in all your connection strings. You might also want to check this link out: http://www.connectionstrings.com/sql-server-2008
Thank you for your guidance. The steps for membership have been followed. I am now able to log onto the site no problems, however when I attempt to log onto any of the pages associated with my websites databse I get this error: -------------------------------------------------------------------------------- Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. --------------------- The web.config above has been adjusted as you suggested. Any ideas?
In MYSITEConnectionString1, change Initial Catalog=SQL2008_MYSITE_user to Initial Catalog=SQL2008_721444_MYSITE_user.
No Success... same error. I also have inherited a new annoying problem whereby when I first enter the website a WINDOWS SECURITY pop up appears asking for my credentials, which won't accept my credentials but oddly when I choose cancel it directs to my log in page that does... Here is my web.config connection string as it stands right now: Code: <connectionStrings> <remove name="LocalSqlServer" /> <add name="LocalSqlServer" connectionString="Data Source=tcp:sql2k803.discountasp.net;Initial Catalog=SQL2008_721444_aspnetdb;User ID=SQL2008_721444_aspnetdb_user;Password=XXXXX;Integrated Security=False" providerName="System.Data.SqlClient" /> <add name="MYSITEConnectionString1" connectionString="Data Source=tcp:sql2k803.discountasp.net;Initial Catalog=SQL2008_721444_pep_user;User ID=SQL2008_721444_MYSITE_user;Password=XXXXX;Integrated Security=True; Connect Timeout=30;" providerName="System.Data.SqlClient" /> <add name="ASPNETDBConnectionString1" connectionString="Data Source=tcp:sql2k803.discountasp.net;Initial Catalog=SQL2008_721444_aspnetdb_user;User ID=SQL2008_721444_aspnetdb_user;Password=XXXXX; Integrated Security=True;" providerName="System.Data.SqlClient" /> </connectionStrings> Note, before adding the memberships I could get in fine but now when I remove the memberships I still draw the same error. Log In Failed.... Here is full error which I get no matter which of the pages I am accessing - note that not all of them have the databind error as this is obviously related to the fact that this page has a gridview. Some of them have tables and I cannot get into them either. Code: Server Error in '/' Application. -------------------------------------------------------------------------------- Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. Source Error: Line 20: Line 21: Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete Line 22: gvMYGRID.DataBind() Source File: E:\web\WEBSITE\htdocs\Lists\WEBPAGE.aspx.vb Line: 22 Stack Trace: [SqlException (0x80131904): Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849719 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117 System.Data.SqlClient.SqlConnection.Open() +122 System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1297 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 System.Web.UI.WebControls.GridView.DataBind() +4 Default3.Page_LoadComplete(Object sender, EventArgs e) in E:\web\harkenitcom\htdocs\Lists\L_Expenses.aspx.vb:22 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Page.OnLoadComplete(EventArgs e) +8703270 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +735
I was able to solve the problem by removing the Integrated Security=True line. I am still encountering the pop up security alert asking for credentials prior to arriving on the login page. But right now celebrating! Thank you for the guidance and support.