Error creating store procedure

6 posts, 0 answers
  1. Piotr
    Piotr avatar
    5 posts
    Member since:
    Aug 2012

    Posted 12 Nov 2010 Link to this post

    For first I'm sorry for my English,

    I started use your components. There are very interested.

    I have problem with add stored procedure (CUD) to object in rlinq file. When I don't use stored procedure is ok and I can save project without problem. When I add one procedure (for example Create) and when I want save changes in rlinq file I get error "Value cannot be null. Parameter name: value".

    I use VS2010,
    ORM Domain Model,
    Mapping type: Attributes, check Generate Context, check Generate multiple file.

    My rlinq file is in dll project (not exec because it will be run in exec - delivery by another company).

    Could you help me?

    Have a nice day.
  2. PetarP
    PetarP avatar
    754 posts

    Posted 15 Nov 2010 Link to this post

    Hi Piotr,

     I tested the same thing using Q3 2010. Everything worked as expected. Can you please share with us as much information as possible regarding your scenario? Are you using default mapping? What types are the columns in your table for which you are creating a stored procedure?
    We look forward to your reply.

    Sincerely yours,
    the Telerik team
    See What's New in Telerik OpenAccess ORM in Q3 2010!
    Monday, November 15, 11 am Eastern Time: Register here>>
    Monday, November 15, 10 pm Eastern Time: Register here>>
  3. DevCraft banner
  4. Piotr
    Piotr avatar
    5 posts
    Member since:
    Aug 2012

    Posted 15 Nov 2010 Link to this post

    Hi Telerik,

    I attach my VS sample project:
    In project I add simple class to rlinq file. I cannot save it if I add stored procedure to CRUD operations. Stored procedure is create by option '<create new procedure...>'. I have this problem when I try create WinForms applications or DLL project.

    For more information:

    I was instaled ORM Q2 2010, uninstal ORM Q2 2010, install ORM Q3 2010.

    Windows 7 x64 bit Professional ver. 6.1.7600

    VS 2010 professional:
    Microsoft Visual Studio 2010 Version 10.0.30319.1 RTMRel
    Microsoft .NET Framework Version 4.0.30319 RTMRel
    Installed Version: Professional
    Microsoft Office Developer Tools   01018-587-2730934-70437
    Microsoft Visual Basic 2010   01018-587-2730934-70437
    Microsoft Visual C# 2010   01018-587-2730934-70437
    Microsoft Visual C++ 2010   01018-587-2730934-70437
    Microsoft Visual F# 2010   01018-587-2730934-70437
    Microsoft Visual Studio 2010 Team Explorer   01018-587-2730934-70437
    Microsoft Visual Web Developer 2010   01018-587-2730934-70437
    Crystal Reports Templates for Microsoft Visual Studio 2010  
    Microsoft Visual Studio 2010 SharePoint Developer Tools   10.0.30319
    Telerik MVC VSExtensions   2010.03.1109.0
    Telerik Extensions for ASP.NET MVC VSExtensions Package
    Telerik OpenAccess ORM   2010.3.1110.2
    Telerik OpenAccess ORM Copyright (C) 1996-2010 Telerik; OpenAccess is the Object-Relational Mapping Tool for the Microsoft .NET
    Telerik Reporting   
    Telerik Silverlight VSExtensions   2010.03.1109.0
    Telerik RadControls for Silverlight VSExtensions Package
    Telerik UserSettings VSExtensions
    Telerik WebUI VSExtensions   2010.03.1109.0
    Telerik RadControls for ASP.NET AJAX VSExtensions Package
    Telerik WinForms VSExtensions   2010.03.1109.0
    Telerik RadControls for WinForms VSExtensions Package
    Telerik WPF VSExtensions   2010.03.1109.0
    Telerik RadControls for WPF VSExtensions Package

    Thank you for your help.

    Have a nice day,
  5. Petko_I
    Petko_I avatar
    184 posts

    Posted 18 Nov 2010 Link to this post

    Hello Piotr,

    We have successfully reproduced the error thanks to your example. What we see is that your model is not serialized correctly. The fields of the entity that you want to create a procedure for have no AdoTypes set for the mapped columns. As a result OpenAccess tries to create a procedure with parameters for which the type is unknown. You can see how the serialized model looks if you open the .rlinq file with an XML editor. We are really interested in knowing how you created your model with the invalid settings. Can you give us the database definition? Can you also try and recreate the model, i.e. delete the .rlinq file and add a new one? We will continue testing in the meantime and will try to reproduce the behavior from scratch. 

    We are looking forward to resolving this issue.

    All the best,
    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
  6. Piotr
    Piotr avatar
    5 posts
    Member since:
    Aug 2012

    Posted 21 Nov 2010 Link to this post

    Hi Telerik,

    I'm sorry for reply so long.
    I put printscreen from my operation in docx file: errorORM_20101121.docx

    I hope this screens help you, to explains, why I can't save project use ORM Domain Model.
    Maybe I do some wrong because It's my first project ORM. I recreate rlinq file many times and it no help.

    I have one more question:
    I want add my deffinition object to existing database. It has many tables and works in client. I wand read some tables and views from this database (but not everything) and create my tables in this database. I must have two rlinq file?

    Have a nice day.
  7. Petko_I
    Petko_I avatar
    184 posts

    Posted 24 Nov 2010 Link to this post

    Hello Piotr,

    Thank you for providing the steps you followed - we really appreciate that you took your time to describe your situation. We reproduced the behavior and we will provide a resolution for the next distribution of OpenAccess after the service pack. A few improvements will be provided with regard to the stored procedures for the service packs, so I would suggest downloading the latest version when it becomes available.

    Concerning your issue, the culprit turned out to be the addition of a new table through the Table Editor. As we provide only SQL types for the columns, the CUD procedure parameters have no valid CLR Type inferred and we throw an exception. As I mentioned we will provide a resolution for this as soon as possible.

    With regard to the existing model that you have I would like to make some clarifications. You can start with populating your model from the database and select only the tables that you want to map. You can use OpenAccess for round-trip mapping, i.e. you may add a new entity in the designer surface and later decide to update your database so that the new entity has a relational representation. This means that you can utilize the same .rlinq file to refine your model, add new entities and associations and also update the model from any changes in the database schema. Here is a link to a blog post presenting the Update Schema Wizard. In order to achieve your goal of creating the CUD procedure for the entity I would suggest to do the following:

    1.Drag a MetaClass from the toolbox.

    2.Define the properties you need for the new entity.

    4.Update your database by right-clicking the design surface and selecting the Update Database From Model option.

    5.Update your model to include the relational information about the newly created table – right-click the design surface and choose Update From Database

    6.With the help of the Mapping Details Editor map the table to the entity

    7.Proceed with the generation of the CUD procedure – afterwards you can use the Update Schema Wizard to generate the SQL script for the procedure

    Please, find your Telerik points updated for bringing the issue with the Table Editor to our attention. Do not hesitate to contact us if you have any questions.

    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Back to Top
DevCraft banner