Thursday, March 29, 2012

help with connectionString

Hello,

I have just tried to deploy my app from my local pc to our server and I have been getting this error.

Server Error in '/' Application.

Configuration Error

Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

Source Error:

Line 164: <providers>Line 165: <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/"Line 166: type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />Line 167: <add name="AspNetWindowsTokenRoleProvider" applicationName="/"Line 168: type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />


Source File:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config Line:166


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

I am new to SQLExpress 2005 and asp.net 2.0. I created some database files on my local pc then copied the whole app to the server. Not sure what to do.

Any help would be greatly appreciated or direction to info.

Thanks Matt

Matt,

Please make sure the membership tables already created on your production server.
Also, check your web or virtual directory is running on top of .Net 2.0

Choirul|||

You need to deploy your database to the remote server as well with the web application. You also need to update the connection string in your web.config file. For example:

<add name="LocalSqlServer" connectionString="Data Source=yournewremotelocationdatabase;Initial Catalog=table;Persist Security Info=True;User ID=yourid;Password=yourpassword" />

Hope that helps.


|||

Thanks for the help. I looked at my application and I have to we.config files. One for the entire application and one for the secured pages under the members folder.

I changed the connectionStrings in the application web.confin but there is no connectionString in the members section.

<?

xmlversion="1.0"encoding="utf-8"?>

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<

system.web>

<

authorization>

<

denyusers="?" />

</

authorization>

</

system.web>

</configuration>

Using VWD it says

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem:The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty. (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 140)

When I try to choose the data provider it tells me:

Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.

I then tried to run the aspnet_regsql and got:

Setup failed.

Exception:
Unable to connect to SQL Server database.

------------
Details of failure
------------

System.Web.HttpException: Unable to connect to SQL Server database. --> System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString)
-- End of inner exception stack trace --
at System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString)
at System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install)
at System.Web.Management.SqlServices.Install(String database, SqlFeatures features, String connectionString)
at System.Web.Management.ConfirmPanel.Execute()

So at this point I guess I am lost. I would appreciate any help. Can you recommend a good resource for SQLEpress learning?

Thanks Again Matt

|||The problem should be on your connectionstring. It fails searching LocalSqlServer, which is the default connectionstring name for membership database.Make sure your connectionstring name is "LocalSqlServer". If you want to use another name, you can specify it on connectionStringName of membership section in web.config.

<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="myConnectionString"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="4"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
applicationName="/myapp"/>
</providers>
</membership
It will help if you can post your application web.config here too :)|||

Thanks for the help. Here is the app web.config. Below is the connectionStrings for my App_Data folder.

<?

xmlversion="1.0"?>

<!--

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<

configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<!--

The configSections define a section for ASP.NET Atlas.

-->

<

configSections>

<

sectionGroupname="microsoft.web"type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup">

<

sectionname="converters"type="Microsoft.Web.Configuration.ConvertersSection"requirePermission="false"/>

<

sectionname="webServices"type="Microsoft.Web.Configuration.WebServicesSection"requirePermission="false"/>

<

sectionname="authenticationService"type="Microsoft.Web.Configuration.AuthenticationServiceSection"requirePermission="false"/>

<

sectionname="profileService"type="Microsoft.Web.Configuration.ProfileServiceSection"requirePermission="false"/>

</

sectionGroup>

</

configSections>

<!--

The microsoft.web section defines items required for the Atlas framework.

-->

<

microsoft.web>

<

converters>

<

addtype="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/>

<

addtype="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/>

<

addtype="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/>

</

converters>

<

webServicesenableBrowserAccess="true"/>

<!--

Uncomment this line to enable the authentication service.

<authenticationService enabled="true" />

-->

<!--

Uncomment these lines to enable the profile service. To allow profile properties to be retrieved

and modified in Atlas applications, you need to add each property name to the setProperties and

getProperties attributes. If you intend for all properties to be available, you can use "*"

as a shorthand rather than enumerating each property

-->

<!--

<profileService enabled="true"

setProperties="propertyname1;propertyname2"

getProperties="propertyname1;propertyname2" />

-->

</

microsoft.web>

<

appSettings/>

<

connectionStrings>

<

addname="MSFADatabaseConnectionStringDistrict1Blog"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\myWebApp\AtlasMSFA\App_Data\MSFADatabase.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="MSFADatabaseConnectionStringDistrict2Blog"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\myWebApp\AtlasMSFA\App_Data\MSFADatabase.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="MSFADatabaseConnectionStringDistrict3Blog"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\myWebApp\AtlasMSFA\App_Data\MSFADatabase.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="MSFADatabaseConnectionStringDistrict4Blog"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\myWebApp\AtlasMSFA\App_Data\MSFADatabase.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="MSFADatabaseConnectionStringAtLargeBlog"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\myWebApp\AtlasMSFA\App_Data\MSFADatabase.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="MSFADatabaseConnectionStringPresidentBlog"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\myWebApp\AtlasMSFA\App_Data\MSFADatabase.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="MSFADatabaseConnectionStringSecretaryTreasurerBlog"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\myWebApp\AtlasMSFA\App_Data\MSFADatabase.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

addname="MSFADatabaseConnectionStringVicePresidentBlog"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\myWebApp\AtlasMSFA\App_Data\MSFADatabase.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

</

connectionStrings>

<

system.web>

<

authorization>

<

allowroles="administrator" />

</

authorization>

<

roleManagerenabled="true" />

<

authenticationmode="Forms" />

<

pages>

<

controls>

<

addnamespace="Microsoft.Web.UI"assembly="Microsoft.Web.Atlas"tagPrefix="atlas"/>

<

addnamespace="Microsoft.Web.UI.Controls"assembly="Microsoft.Web.Atlas"tagPrefix="atlas"/>

</

controls>

</

pages>

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

-->

<

compilationdebug="true">

<

buildProviders>

<

addextension=".asbx"type="Microsoft.Web.Services.BridgeBuildProvider"/>

</

buildProviders>

</

compilation>

<!--

ASMX is mapped to a new handler so that proxy javascripts can also be served.

-->

<

httpHandlers>

<

removeverb="*"path="*.asmx"/>

<

addverb="*"path="*.asmx"type="Microsoft.Web.Services.ScriptHandlerFactory"validate="false"/>

<!--

The MultiRequestHandler enables multiple requests to be handled in one

roundtrip to the server. Its use requires Full Trust.

-->

<

addverb="*"path="atlasbatchcall.axd"type="Microsoft.Web.Services.MultiRequestHandler"validate="false"/>

<

addverb="*"path="atlasglob.axd"type="Microsoft.Web.Globalization.GlobalizationHandler"validate="false"/>

<!--

The IFrameHandler enables a limited form of cross-domain calls to 'Atlas' web services.

This should only be enabled if you need this functionality and you're willing to expose

the data publicly on the Internet.

To use it, you will also need to add the attribute [WebOperation(true, ResponseFormatMode.Json, true)]

on the methods that you want to be called cross-domain.

This attribute is by default on any DataService's GetData method.

<add verb="*" path="iframecall.axd" type="Microsoft.Web.Services.IFrameHandler" validate="false"/>

-->

<

addverb="*"path="*.asbx"type="Microsoft.Web.Services.ScriptHandlerFactory"validate="false"/>

</

httpHandlers>

<

httpModules>

<

addname="ScriptModule"type="Microsoft.Web.Services.ScriptModule"/>

<

addname="BridgeModule"type="Microsoft.Web.Services.BridgeModule"/>

<

addname="WebResourceCompression"type="Microsoft.Web.Services.WebResourceCompressionModule"/>

</

httpModules>

<!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

<authentication mode="Windows"/>

-->

<!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm"/>

<error statusCode="404" redirect="FileNotFound.htm"/>

</customErrors>

-->

</

system.web>

<!--

Uncomment this if your site globally denies access to anonymous users. The

authentication service and profile service are located under the virtual

"ScriptServices" directory. Since you normally call the authentication web

service with an un-authenticated user, the following location tag can be used

to grant access to anonymous users. If you use anonymous profile support

you will also need to grant access to anonymous users.

-->

<!--

<location path="ScriptServices">

<system.web>

<authorization>

<allow users="*" />

</authorization>

</system.web>

</location>

-->

</

configuration>

Thanks Matt

|||Hi,

You're missing the connection string for ASP.NET membership. The default name is "localSqlServer". Try to add this conn string:

<addname="localSqlServer"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\myWebApp\AtlasMSFA\App_Data\MSFADatabase.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

also, make sure you've added membership tables in MSFADatabase.mdf.

If you want another name instead of "localSqlServer", please refer to my previous post :)


|||

Thanks for the Help. That seamed to fix that problem. I really appreciate it. My Default.aspx page came up. But when I try to navigate to a page containing a database this is what I get.

Server Error in '/' Application.

An attempt to attach an auto-named database for file C:\myWebApps\AtlasMSFA\App_Data\MSFADatabase.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

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: An attempt to attach an auto-named database for file C:\myWebApps\AtlasMSFA\App_Data\MSFADatabase.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): An attempt to attach an auto-named database for file C:\myWebApps\AtlasMSFA\App_Data\MSFADatabase.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.] System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +437 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.GridView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +41 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

And also when I try to login in I get this.

Server Error in '/' Application.

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

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: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857306 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734918 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135 System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider, SqlConnection connection, String[] features, String version, Int32& schemaVersionCheck) +367 System.Web.Security.SqlMembershipProvider.CheckSchemaVersion(SqlConnection connection) +85 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160 System.Web.UI.WebControls.Login.AttemptLogin() +105 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Thank you again for the help.

Thanks Matt

|||hi,
Make sure SQLExpress is running on your deployment server, and asp.net membership tables is already exists in MSFADatabase.mdf.
You may need to change the path for database file as follow, so it will search your deployement folder accordingly, instead of hardcoded the database file location.

<

addname="MSFADatabaseConnectionStringDistrictBlog"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|MSFADatabase.mdf; Integrated Security=True;Connect Timeout=30;User Instance=True"providerName="System.Data.SqlClient" />

<

|||

Thank you again for the help. I have tried your suggestion and it did not seam to work. Also I have checked my application and the tables all appear to be there. It looks like all the data copied correctly from my local pc to my server. I am able to right click on the asnet_Membership table, select "Show Table Data", and view the users I have created. Also the MSFADatabase.mdf table are there and the data.

I have tried to use the ASP.NET Website Administration Tool. When I click the security tab this is the error I get,

There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.

The following message may help in diagnosing the problem:Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

When I choose the data store it is able to successfully connect toAspNetSqlProvider.

I am not sure what is going on.

How can I check to make sure SQLExpress 2005 is running?

Thanks you again.

Matt

|||hi,

run sqlcmd -L in your command prompt, it will display any sql server instance in your network. Make sure sqlexpress is up in production server.

About error regarding to reole provider, add this section in your web.config:

<roleManager enabled="true">
<providers>
<clear/>
<add connectionStringName="yourconnectionstringname" applicationName="/yourapplicationname" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<remove name="AspNetWindowsTokenRoleProvider"/>
</providers>
</roleManager
don't forget to repace connstringname and application name accordingly|||

Once again thank you for the help. Running sqlcmd-L helped with the one part. I appreciate all your help. I still can seem to get the login in to work. I am still getting:

Server Error in '/' Application.

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

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: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857306 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734918 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135 System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider, SqlConnection connection, String[] features, String version, Int32& schemaVersionCheck) +367 System.Web.Security.SqlMembershipProvider.CheckSchemaVersion(SqlConnection connection) +85 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160 System.Web.UI.WebControls.Login.AttemptLogin() +105 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

I have checked the event log on my server and am getting a couple of errors.

Event ID: 17401, MSSQL$SQLEXPRESS and Event ID: 1309 ASP.NET 2.0.50727.0

If I am correct this has something to do with the SQLExpress being idle? I don't believe that it is a timeout problem as the error comes up immediately.

Any Ideas?

Thanks Matt

|||Did you check if'dbo.aspnet_CheckSchemaVersion' really exists in your database?|||

No. I am not sure what that is? It does not look like it is there if I explore the database.

Thanks Matt

No comments:

Post a Comment