This is a migrated thread and some comments may be shown as answers.

Unable to start Linq2Sql to Open Access Domain model wizard

5 Answers 122 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vamsi
Top achievements
Rank 1
Vamsi asked on 18 Dec 2010, 02:43 AM
Hi, I am evaluating the Open access ORM in hopes to get rid of my Linq2Sql Model. I installed the full version on my box and when I see the context menu on dbml modal file there is no entry for starting the conversion wizard. Please tell me if I am missing any thing.

5 Answers, 1 is accepted

Sort by
0
Pencho
Telerik team
answered on 20 Dec 2010, 06:32 PM
Hi Vamsi,

First I would like to thank you about your interest in the L2S to OpenAccess converter. This is a known issue. To start the l2s conversion wizard, please select your dbml file in Solution Explorer and then use the command from the Telerik menu - Telerik -> OpenAccess -> Convert from L2SQL (see the attached image for more info). That command is available only in the latest version of OpenAccess - 2010.3.1125.1.
The problem with the context menu command is that it is a part of the OpenAccess Dsl Package. By default it is not loaded until you explicitly open an Rlinq file in the Visual Designer or start the Create Model wizard. As an experiment, start the Create Model wizard (Telerik -> OpenAccess -> Add domain model) and cancel it immediately. Now the context menu command should be visible.
Sorry for the caused inconvenience. We will be happy if you share with us, if your project has converted successfully.

Best wishes,
Pencho
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Vamsi
Top achievements
Rank 1
answered on 20 Dec 2010, 08:24 PM
Pencho,

I have tried all the workarounds you mentioned and none of them worked. I am using the exact version you mentioned. Here is a screen shot of the Telerik Menu. I also repaired the install with no luck.
0
Accepted
Pencho
Telerik team
answered on 22 Dec 2010, 12:08 PM
Hello Vamsi,

I noted that you are using Visual Studio 2008. Unfortunatelly, the current version of the L2S Converter is available only for Visual Studio 2010. We are planning to add support for VS 2008 in some of the next releases of the product. The workaround is fairly easy, but it requires a lot of steps to be performed:
  1. Create a new project in Visual Studio 2010 (for example, create a console application). My advice is to name the VS2010 project in the same way as the VS2008 project that contains the dbml file. Thus you will avoid any unnecessary namespace conflicts.
  2. Add manually only your DBML file to the VS 2010 project. Open the dbml file in the designer and press the Save command. You may note that a new App/Web.config file will be added automatically to the VS2010 project - it will contain one connection string that is used by the Linq to Sql model.
  3. Build your project and ensure that everything is ok.
  4. Now start the wizard in one of the two ways I described in the previous post.
  5. When/if the project converted successfully a new RLINQ file will be added to the VS 2010 project. This is the converted file. Also, a second connection string will be added to the config file, that is the connection string used by the OpenAccess Domain Model. If the project conversion fails, please send back the generated report to us (we recently found an issue, hope you will not hit it:)).
  6. Open the RLINQ file in the Visual Designer and press the Save command to generate the entities.
  7. You may need to exclude the original Dbml from the project, since classes with the same name and namespace may occur. Build the converted project to ensure that everything is ok.
  8. Probably you will not receive any build errors. You may try to load some entities from the database, to perform some CRUD operations just for a test.
  9. If everything is ok and you are confident of the quality of the converted model, you may consider moving the generated RLINQ file to the VS 2008 project. Just add only the converted RLINQ file to your VS 2008 project. This will add automatically references to Telerik.OpenAccess.dll and Telerik.OpenAccess.35.Extensions.dll. Double-click to open it in the Visual Designer and press the Save command to generate the entities. Again, you should exclude the original dbml file from the project.
  10. Copy and paste the second connection string from the config file in the VS 2010 project, to the corresponding config file in the VS 2008 project.
  11. The final step is a tricky. You  should integrate the OpenAccess enhancer to your VS 2008 project. Telerik OpenAccess ORM uses Enhancer, which is a special enhancer program, to read and process compiled .NET assemblies for adding persistence capability. Without performing that step you won't be able to create a new instance of the OpenAccessContext (respectively won't be able to load data). In the VS2010 project that is done automatically for you by the l2s wizard. To integrate the Enhancer in your project:
    1. Right-click your VS2008 project in the Solution Explorer and select "Unload Project".
    2. Again in the Solution Explorer, right-click on the unloaded project and select Edit ProjectName.csproj.
    3. In your csproj file, find a line like this one:
      <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    4. And import the following code after the aforementioned line:
      <Import Condition="Exists('$(MSBuildExtensionsPath)\OpenAccess.targets')" Project="$(MSBuildExtensionsPath)\OpenAccess.targets" />
    5. Save your changes. Right-click on your project in the Solution Explorer and select Reload Project. Now you have OpenAccess Enhancer integrated with your VS2008 project, the RLINQ file should work at runtime as well.

I hope that the guidance is clear enough. If you have questions or there is any ambiguity, please contact us.


Best wishes,
Pencho
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
Vamsi
Top achievements
Rank 1
answered on 22 Dec 2010, 07:49 PM
Pencho,

Thanks for the detailed instructions which are very helpful. Indeed it would have been better if the limitation is documented.
0
Pencho
Telerik team
answered on 23 Dec 2010, 04:50 PM
Hi Vamsi,

In fact there is a note in the OpenAccess Documentation describing that limitation. You can take a look either at the distributed chm file (Programmers Guide>Getting Started > Converting from L2S Model to OpenAccess Domain Model) or at the online documentation. At the moment there are some missing images in the online article, so whenever you need any reference to OpenAccess ORM, please use the distributed chm file (it can be found locally in the following directory: ~OpenAccess installation directory\documentation\chm ). Also there is a blog post illustrating how to work with the L2S converter. The information in the blog post is almost the same as the information from the official documentation, the only difference is that the limitation is not mentioned there. If you have read only the blog post, please excuse again us for the inconvenience.
If you decide to use the suggested workaround, please let us know what is the end result.

Kind regards,
Pencho
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
Getting Started
Asked by
Vamsi
Top achievements
Rank 1
Answers by
Pencho
Telerik team
Vamsi
Top achievements
Rank 1
Share this question
or