Frage

I have added devart linqconnect ORM to connect to the mysql database. it is a trial version though, i have created a shopping.iqml file in my application which automatically creates a model for the linq to mysql.

when i write using shoppingdatacontext; it works and shows up in the intellisense menu but, when i add a linq datasource from toolbar and when i configure datasource and try to choose data context shoppingDataContext does not appear in the Drop Down list. When i try to manually write the context menu type property of the linqdatasource (which then appears in the configure datasource dropdown) and try to configure it, it gives me an error :

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.

i have tried to add assemblies from project it is still not working and tried other methods to no avail.. i am at my wits end .. please could anybody help me out on this..

My Web.config File is:

<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>

appreciate your help.. thanks in advance..

War es hilfreich?

Lösung

After you have added the Devart LinqConnect model to your project, you should build your application to make all changes to take effect. After you've built it, the 'shoppingdatacontext' will be available in the Drop Down list when configuring datasource for LinqDataSource.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top