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

Forums / General Discussions / How do we add a new Data Source in Sitefinity page?

How do we add a new Data Source in Sitefinity page?

7 posts, 0 answered
  1. Amitabh
    Amitabh avatar
    3 posts
    Registered:
    08 Jun 2010
    08 Jun 2010
    Link to this post
    I have to show a list of Products in a sitefinity page. How do we create a data source for the Product data in Sitefinity?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    08 Jun 2010
    Link to this post
    Hello Amitabh,

    It depends on which module you use. If you use products module you can create an instance of the Products manager and then call Content.GetContent. This will return IList of content items. Here is a lost with all overloads of GetContent method.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Amitabh
    Amitabh avatar
    3 posts
    Registered:
    08 Jun 2010
    08 Jun 2010
    Link to this post
    My data is in a different database? My site is running on DB1 and I have to show data from a different database.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    08 Jun 2010
    Link to this post
    Hello Amitabh,

    Then create a new provider which is points to the other database ( declare a new connection string to the other database and create an additional provider that uses this connection) or use LINQ - SQL or SQL queries to retrieve the data.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Amitabh
    Amitabh avatar
    3 posts
    Registered:
    08 Jun 2010
    08 Jun 2010
    Link to this post
    Do I have to create provider using the UI (Sitefinity Admin) or declare new provider in Web.Config?
  6. Ryan
    Ryan avatar
    2 posts
    Registered:
    24 Jul 2013
    24 Jul 2013
    Link to this post
    My BAD I found the HELPFUL answer --> http://msdn.microsoft.com/en-us/library/ms171887.aspx ... cheers everyone :)

    This is really frustrating I'm also having the same problem and the telerik support seems eluding the issue.
    - How do we create or define a new datasource that is not packaged with Sitefinity?

    Same with here answering with "I've answered your thread elsewhere" does not help the issue http://www.sitefinity.com/developer-network/forums/general-discussions-/cloning-site

    - do we add new seeting on web.config?
    - do we add new item on Visual studio with thunder?
     - do we add config under app_data?

    what are the preferred steps for this.  Say we want to use different database and different table not a custom products table on the main Sitefinity database?  Is this hard to do, complex? Please let us know the answer.

    Thanks
  7. Yavor Slavchev
    Yavor Slavchev avatar
    27 posts
    Registered:
    13 Sep 2016
    24 Jul 2013
    Link to this post
    Hi Ryan,

    Would it be possible for you to inform us which version of Sitefinity you are using?

    Sitefinity is built on top of the Provider Model pattern. In order to get data from a different source for your custom module, you must provide your own implementation for your module provider. For example look at this article:

    http://www.sitefinity.com/documentation/documentationarticles/developers-guide/sitefinity-essentials/modules/creating-custom-modules/creating-products-module/implementing-the-data-model/implementing-openaccess-data-provider


    You can simplify this task by using Sitefinity Thunder Visual Studio add-in. It will helps you not only to implement your provider but also for the registration in Sitefinity and its usage. Take a look at the examples that Sitefinity Thunder provides on its start page when you install it in Visual Studio.

    Regards,
    Yavor Slavchev
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
7 posts, 0 answered