0

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

Gert Arnold
  • 105,341
  • 31
  • 202
  • 291
Vishal Torne
  • 366
  • 5
  • 24

1 Answers1

1

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.

Devart
  • 119,203
  • 23
  • 166
  • 186
  • Still not Working.. the linqdatasource configuration dropdown is populated with devart.Common.design and Devart.Common.NativeMethods and Dotfuscator Attribute And no ShoppingContext which i created. please check my question again i am editing my question and posting my web.config to see if there is a problem in my assembies or configuration strings. please help.. – Vishal Torne Mar 11 '13 at 14:07
  • Please check the following: - Devart LinqConnect model is in App_Code folder of your web site; - there is an available template in your Devart LinqConnect model (please open your model by double-clicking the 'shoppingDataContext.lqml' file, then expand the Templates node in Model Explorer - there should be at least one template, e.g. 'LinqConnect' or 'POCO Entities'); - after saving the model, the code for DataContext and its entities is generated (the 'shoppingDataContext.Designer.cs' file should be generated and non-empty); - your project builds without errors. – Devart Mar 12 '13 at 12:10
  • Thank you devart team, It is working i had gathered many assemblies from in my projects from various sources i cleaned up all that created my settings from the scratch. Your building the solution helped..i just knew how to run the solution but never built it ! thank you for reminding me to build the solution.. one question: i am working on a web application and there is no app code folder but there is a app data folder will that make any difference in my project in the future.. please tell me and thank you for response. – Vishal Torne Mar 12 '13 at 13:29
  • Glad to see that the information we have provided helped you to solve the issue. As for the question about App_Code folder, when working with web application projects it is necessary to place LinqConnect model in this folder and you can just create it selecting 'New Folder' from the context menu of your project in the Solution Explorer and name it App_Code. Please refer here http://stackoverflow.com/questions/2277742/app-code-folder-is-missing-in-vs-2010 http://msdn.microsoft.com/en-us/library/t990ks23%28v=vs.80%29.aspx – Devart Mar 13 '13 at 08:58