I wasn't sure where to ask this, but I wanted to query a legacy database and display it within the CMS as one of the "normal" pages. Can you tell me where to start on that? I have never used Umbraco before but wanted to download and learn. But, I have to be able to query other databases (lots of them) and display them within the cms like any other page. Thanks for direction.
You can configure database access in the web.config in the <appSettings> section and then fetch data and include it on pages with user control based macroes.
You can configure the DB access like this: <add key="Nameofyoudb" value="server=.\SQLEXPRESS2005;database=AdventureWorksLT;user id=user;password=password" />
Then write your user control and place the .dll file in the bin folder and place the user control in the user control folder.
Log in to Umbraco and go to the developer section and under "macros" right click and select "create". When it's created you need to reference the "usercontrol" in the ".NET User Control" input field.
When it's done, hit save and go to the "Settings" section and go to a template where you can place your macro by clicking the 4th button from the left called "insert macro".
Hit save and go to a page that is using the template and you should be able to see the data there :)
How do I query a legacy database?
I wasn't sure where to ask this, but I wanted to query a legacy database and display it within the CMS as one of the "normal" pages. Can you tell me where to start on that? I have never used Umbraco before but wanted to download and learn. But, I have to be able to query other databases (lots of them) and display them within the cms like any other page. Thanks for direction.
Hi John
You can configure database access in the web.config in the <appSettings> section and then fetch data and include it on pages with user control based macroes.
You can configure the DB access like this: <add key="Nameofyoudb" value="server=.\SQLEXPRESS2005;database=AdventureWorksLT;user id=user;password=password" />
Then write your user control and place the .dll file in the bin folder and place the user control in the user control folder.
Log in to Umbraco and go to the developer section and under "macros" right click and select "create". When it's created you need to reference the "usercontrol" in the ".NET User Control" input field.
When it's done, hit save and go to the "Settings" section and go to a template where you can place your macro by clicking the 4th button from the left called "insert macro".
Hit save and go to a page that is using the template and you should be able to see the data there :)
You can also see a more thourough guide on how to setup you project for creating user control base macroes for umbraco here: http://skiltzonnet.blogspot.com/2008/01/creating-you-first-umbraco-user-control.html
Hope this helps.
/Jan
is working on a reply...