簡體   English   中英

無法在devart linconnect中加載數據上下文

[英]cannot load datacontext in devart linconnect

我添加了devart linqconnect ORM以連接到mysql database 不過,這是一個試用版,我在應用程序中創建了一個shopping.iqml文件,該文件自動為linq to mysql創建模型。

當我using shoppingdatacontext;編寫時using shoppingdatacontext; 它工作並顯示在智能感知菜單中,但是,當我從工具欄添加linq datasource ,以及當我配置數據源並嘗試選擇數據上下文時, shoppingDataContext不會出現在下拉列表中。 當我嘗試手動編寫linqdatasource的上下文菜單類型屬性(然后出現在configure datasource下拉列表中)並嘗試對其進行配置時,它給我一個錯誤:

the Type 'ShoppingContext.ShoppingDataContext' could not be loaded. If the type is located in the App_code folder, please check that it compiles. If the type is located in a compiled assemblies, please check that the assembly is referenced by the project.

我試圖從項目中添加程序集,但它仍然無法正常工作,並嘗試了其他方法,但都無濟於事。..我無濟於事..請有人可以幫我這個忙..

我的Web.config文件是:

<configuration>
<connectionStrings>
<remove name="LocalMySqlServer" />


<add name="LocalMySqlServer" connectionString="Server=localhost; Database=shopping; uid=root; pwd=007;"
  providerName="MySql.Data.MySqlClient" />
<add name="ShoppingDataContextConnectionString" connectionString="User Id=root;Password=007;Host=localhost;Database=shopping;Persist Security Info=True" />
</connectionStrings>

<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="Devart.Data.Linq.Web, Version=4.1.197.0, Culture=neutral, PublicKeyToken=09AF7300EEC23701"/>
    <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="Devart.Data.Linq, Version=4.1.197.0, Culture=neutral, PublicKeyToken=09AF7300EEC23701"/>
</assemblies>

  </compilation>
<authentication mode="Forms">
  <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
</authentication>
<membership defaultProvider="MySqlMembershipProvider">
  <providers>
    <clear/>
    <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.5.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requireQuestionAndAnswer="false" requireUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="0" passwordStrengthRegularExpression="" applicationName="/" autogenerateschema="true"/>
  </providers>
</membership>

感謝您的幫助..在此先感謝..

將Devart LinqConnect模型添加到項目中之后,應構建應用程序以使所有更改生效。 構建好它之后,為LinqDataSource配置數據源時,“下拉列表”中將提供“ shoppingdatacontext”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM