0

我已添加devart linqconnect ORM以连接到mysql database. 虽然它是试用版,但我shopping.iqml在我的应用程序中创建了一个文件,它会自动为linq to mysql.

当我编写using shoppingdatacontext;它时它可以工作并显示在智能感知菜单中但是,当我linq datasource从工具栏添加一个并且当我配置数据源并尝试选择数据上下文时shoppingDataContext,它不会出现在下拉列表中。当我尝试手动编写 linqdatasource 的上下文菜单类型属性(然后出现在配置数据源下拉列表中)并尝试对其进行配置时,它给了我一个错误:

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>

感谢您的帮助..提前谢谢..

4

1 回答 1

1

将 Devart LinqConnect 模型添加到项目后,您应该构建应用程序以使所有更改生效。构建完成后,为 LinqDataSource 配置数据源时,“shoppingdatacontext”将在下拉列表中可用。

于 2013-03-11T12:34:23.223 回答