+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How to use my own table is Sitefinity

How to use my own table is Sitefinity

9 posts, 0 answered
  1. test
    test avatar
    4 posts
    Registered:
    24 Jun 2016
    15 Jul
    Link to this post

    Hi,

    I have an issue to using my own table in sitefinity, for example i want to upload data by SSMS and display it in sitefinity widget or edit the data in my own table through sitefinity.
    What tools should i install? what skill should i have(may be MS LINQ)? or any others requirments should i have?
    Anyone can give me simple example about this?

    And secondly, if i used standard sitefinty widget(for example blog widget), the posts must be stored somewhere in database, but i don't know to extract it for reporting purpose for example.

    Thanks before..

    Regards,

    Eddy

  2. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    15 Jul in reply to test
    Link to this post

    Hi,

    You need to create Dynamic Module. It will automatically create table in DB and you will be able to edit information through Sitefinity backend. And show it for visitors in fronteng with autogenerated widget for this dynamic module

    You can find more useful information here: http://docs.sitefinity.com/overview-dynamic-modules-and-the-module-builder

  3. test
    test avatar
    4 posts
    Registered:
    24 Jun 2016
    18 Jul
    Link to this post

    Hi Victor,

    Thanks for the explanations and suggestions, it's very useful, i am exploring it for this moment.

    Regards,

    Eddy

  4. test
    test avatar
    4 posts
    Registered:
    24 Jun 2016
    25 Jul
    Link to this post

    Hi Victor,

    I have tried using Module Builder for creating Dynamic Module (just say: myModule), Dynamic Content Type (just say:MyType), and Dynamic Content Items, and i can see that the table structure following the structure of my Dynamic Content Type plus an additional field "BASE_ID" that defined by Sitefinity.

    At this point, i can insert or edit something like a post or a transaction using Sitefinity Backend (create Content Items), and the table is reflected the changes.

    But i still can not insert rows directly to my table because i dont have the GUID number for filling BASE_ID field, and my table has relation to table SF_DYNAMIC_CONTENT too.

    My purpose is to insert many rows (as a master table in my application) at once.

    How to achieve this?

     

    Regards,

    Eddy

     

     

     

     

  5. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    25 Jul in reply to test
    Link to this post

    Hi Eddy. You need to do it through sitefintiy API or webservice.

    As example, you can check this article http://www.sitefinity.com/blogs/tim-williamsons-blog/2013/11/20/importing-data-into-custom-modules

  6. test
    test avatar
    4 posts
    Registered:
    24 Jun 2016
    25 Jul
    Link to this post

    Hi Victor,

    I think this link would be a good entry point for me, thanks a lot.

    Regards,

    Eddy

  7. test
    test avatar
    4 posts
    Registered:
    24 Jun 2016
    26 Jul
    Link to this post

    Hi Victor,

    I have a little problem when applying it.

    So, when i used DynamicContent class, it seems there no SetString procedure, am I missing something?

    Regards,

    Eddy

     

    here are my snipped codes:

    using Telerik.Sitefinity.DynamicModules.Model;
    ...
    public static void CreateStore(Store s)
    {
       ...
       DynamicContent storeItem = dynamicModuleManager.CreateDataItem(storeType);
       
       // This is how values for the properties are set
       storeItem.SetString("Title", s.Title, cultureName);
       storeItem.SetString("Phone", s.Phone, cultureName);
       ...
    }

     

  8. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    26 Jul in reply to test
    Link to this post

    Hi Eddy, you need to add this using:

    using Telerik.Sitefinity.Model;

    And i want to tell you small hint, what can help you with API

    Go to Administration -> Module Builder -> Choose your module -> In the right sidebar click to "Code reference..."  

    On this page you will find many code samples for your module

  9. test
    test avatar
    4 posts
    Registered:
    24 Jun 2016
    26 Jul
    Link to this post

    Hi Victor,

    Ok, thanks for the enlightenments, very helpful..

    Regards,

    Eddy

9 posts, 0 answered