2011-11-28 4 views
3

これまでの通常の接続ですべてがスムーズでした しかし、データエンティティモデルと新しい接続文字列に切り替えました。このエラーは...私のデータ操作のために私のエンティティの文字列を保持し、ログイン制御のためにのみ通常のconn文字列を使用することができますか?ASP.NETログイン制御接続文字列エラー:キーワードがサポートされていません: 'メタデータ'

Keyword not supported: 'metadata'. 
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.ArgumentException: Keyword not supported: 'metadata'. 

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: 

[ArgumentException: Keyword not supported: 'metadata'.] 
    System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +5055124 
    System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98 
    System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +64 
    System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24 
    System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +150 
    System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +59 
    System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4 
    System.Data.SqlClient.SqlConnection..ctor(String connectionString) +26 
    System.Web.DataAccess.SqlConnectionHolder..ctor(String connectionString) +54 

[ArgumentException: An error occurred while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax. 
Parameter name: connectionString] 
    System.Web.DataAccess.SqlConnectionHolder..ctor(String connectionString) +136 
    System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +119 
    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) +827 
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 
    System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +106 
    System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60 
    System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +129 
    System.Web.UI.WebControls.Login.AttemptLogin() +127 
    System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101 
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125 
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167 
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563 

接続文字列の答えを見つけ

<connectionStrings> 
    <add name="LoginDB" connectionString="Data Source=****;Initial Catalog=int422_113b16;User ID=****;Password=****" /> 
    <add name="BlogEntities" connectionString="metadata=res://*/App_Code.BlogModel.csdl|res://*/App_Code.BlogModel.ssdl|res://*/App_Code.BlogModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source****;initial catalog=int422_113b16;user id=****;password=****;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /> 
</connectionStrings> 
+0

いただきましたごたconnectionStringのコードのために、正しい形式ではありませんでした? –

+0

App.configとWebConfigに接続文字列を配置してみます。 – BizApps

答えて

6

... はちょうど私がしなければならなかったすべては、プロバイダタグ

のためのconnectionStringNameを変更した合理的にそれについて考えて、設定ファイル をチェックします誰かが同じ問題に遭遇した場合、将来参照するために

0

私はカスタムユーザーコントロールを開発していました。テストアプリケーションで同じものを使用しても問題は解決しませんが、同じものをデプロイしようとすると、同じエラーが発生し、カスタムコントロールのコードの次の行がブラウザで赤く強調表示されます:

エラー:サポートされていない

キーワード: 'メタデータ'。 +

System.Data.Common.DbConnectionOptions.ParseInternal(Hashtableの parsetable、文字列れたconnectionString、ブールbuildChain、Hashtableの 同義語、ブールのfirstKey):

以下はスタックトレースの最初の数行です5110852
System.Data.Common.DbConnectionOptions..ctor(文字列れたconnectionString、 ハッシュテーブル同義語、ブールuseOdbcRules)+98

理由は、私の場合は、接続文字列は、詳細な説明を訪問http://www.connectionstrings.com/

関連する問題