Site structure
Version 7.x > Site structure > Display data from non-Kentico SQL database through a structured document View modes: 
User avatar
Member
Member
kyle.dahlgren-66fcu - 6/13/2013 11:44:51 AM
   
Display data from non-Kentico SQL database through a structured document
Let me set up the structure I have on my site so that this is more understandable. I have a SQL database that is not the Kentico database that I store information in. I have a series of structured documents that share a single template, therefore the webparts on the template carry over to each structured document. I have a need to display differing information from the SQL database on each of these structured pages. I know I can use query repeaters to pull data from the database because I'm already doing that on other pages, however because these structured pages share a template the repeater would display the same information for each, whereas I need different information from the database on each page. I've tried figuring out if there is an attribute type and form control available through the structured document that will allow me to pull from the external SQL database, but have not found the solution that way. So my question is, can I pull and display different data pieces from a non-Kentico SQL database to display on a structured document that shares a single template with other structured documents?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/13/2013 1:40:42 PM
   
RE:Display data from non-Kentico SQL database through a structured document
Hi,

I think, it may be easier to create separate templates. Otherwise, you can try using macros in the web part settings - they are resolved dynamically according to current context - so you can have the web part settings set on the fly.
Another option I have on top of my mind is to do this directly in the web part's code behind - add a logic, conditions that will check current context (just like the macros) and perform/set whatever you need.

Best regards,
Juraj Ondrus

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 6/13/2013 2:02:09 PM
   
RE:Display data from non-Kentico SQL database through a structured document
Kyle,

I'm going through the exact same thing right now with user profile information/data. All demographic data is stored elsewhere and only login info is stored within Kentico. I'm working out a custom webpart to make it appear as if they all came from the same place. If you know anything about creating webparts, its no harder than creating an ascx control and placing it on a page.

Best of luck
Brenden