Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Garrett Fisher 341 posts 496 karma points
    Nov 13, 2009 @ 20:11
    Garrett Fisher
    0

    talking to another database from umbraco

    Hi,

    I've got a challenge before me.  I'm creating a site for a client in Umbraco.  The client has an existing webapp (an Assembly) which uses its own database, API's etc.  Will this work in Umbraco?  How would I go about this intregration?  I mean, I can't just put ASP.NET code dierctly into templates, can I?  How can I connect to this other database and serve data from it to Umbraco-managed pages?

    I don't know where to start, or even what questions to ask.

    Thanks,

    Garrett

  • Ricky Beard 61 posts 116 karma points
    Nov 13, 2009 @ 20:33
    Ricky Beard
    1

    Do you have the web app source? You can move all of the code from the web forms to user controls, compile the app, then add them to Umbraco with macros. Basically replacing .aspx files with .ascx files dropped on templates or content nodes.

  • Gregory Heeren 9 posts 29 karma points
    Nov 16, 2009 @ 09:37
    Gregory Heeren
    0

    We did this for a client too. We integrated directly with their MS SQL database. Within our XSLT files, we'd have a call to a home-grown function "GetExternalData(string sqlquery)" which would fetch the data from their database in XML format. This would then be easy to handle in the XSLT file as if it were coming from Umbraco itself.

    If you need concrete examples, let me know

    Tip: if you're going to work with a MS SQL database, have a look at the FOR XML clause. This proved to be way better for performance rather than using the .NET Dataset to XML function.

  • Garrett Fisher 341 posts 496 karma points
    Nov 16, 2009 @ 16:44
    Garrett Fisher
    0

    Yes, I have full access to the source.  I don't yet know enough about what the requirements are; I just wanted to send a ping out there to see if this is even Possible.  Sounds like it is.  I'll be back in the forum after I gather some more info.  Thanks for the replies, guys!

    //Garrett

  • Garrett Fisher 341 posts 496 karma points
    Dec 10, 2009 @ 16:53
    Garrett Fisher
    0

    Hello again--

    Ricky, so I've built out the rest of the site (the static parts), and now I'm ready to start trying to get this to work within an Umbraco-hosted page.  Here is a link to a screenshot of the usercontrols subdirectory which contains the compiled assembly (as I said, I also have an uncompiled version though I don't know if I need it):

    http://dl.dropbox.com/u/2245351/sitelocator-assembly.gif

    The developers who built this app says it works fine and have also staged a version elsewhere on the internet and I have verified this.  They also checked out Umbraco and said the following:

    "

    Basically, to incorporate this in your project you will need to add references to the binaries you see in the warnings below.  Right click on the web project and do “Add Reference”.  Then browse on the file system to the following.

    GTP.Search.dll
    GTP.Geography.dll
    GTP.DataAccess.dll
    GTP.DataAccess.Polaris.dll

    These should all be located in the bin folder of the demo project.

    Create a User control for the search form in your Umbraco project and you should then have access to the above assemblies as they are used in the demo.  Also make sure to get the connection string from the web.config.  The binary files will pick up their connection from there

    "

    But obviously he's working in Visual Studio.  I am not.  We don't have a license here.  If this app is built already, #1, why do I have to create these references he's talking about?  And #2, how do I create the Macro? I understand from my research that I put the path to the DLL in the ".NET User Control" field, yes?  I don't know which DLL, though (there are even more than what is listed above), nor do I know whether to include the file extension.  What do you think of all this, Ricky?!

    Thanks in advance,

    Garrett

     

  • Ricky Beard 61 posts 116 karma points
    Dec 11, 2009 @ 17:45
    Ricky Beard
    0

    If you copy the assemblies to your bin directory, you should be able to add a "using" statement (or "imports" for vb) at the top of the code behind for your user controls.

    Then, you need to create a user control to replace each web form you are currently using in your static build.  Simply create an empty user control, copy any necessary markup and code from the code behind over from your web form and save.

    It is those user controls (.ascx files) that you will see available from the drop down in the macro settings.

     

Please Sign in or register to post replies

Write your reply to:

Draft