Copied to clipboard

Flag this post as spam?

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


  • Paul D. 12 posts 32 karma points
    Jan 28, 2010 @ 18:41
    Paul D.
    0

    How work with db form macro?

    hi, help pleaz

    How right work with db form macro?

    how create tables from umbraco pack?

     

    thnks

  • Tommy Poulsen 514 posts 708 karma points
    Jan 28, 2010 @ 19:00
    Tommy Poulsen
    0

    Hi Paul

    Jesper Ordrup made a xslt extension to use in macros for accessing SQL Server databases. See here

    I have a gridview package coming up for making gridviews using SQLServer datasources.

    I'll post it on the forum as soon as its ready for download.

     

    >Tommy

     

  • Paul D. 12 posts 32 karma points
    Jan 28, 2010 @ 21:38
    Paul D.
    0

    is good 

    but I am interested in accessing the database through a web сotnrol(not xslt macro), I wonder, have umbraco a special interface for handling sql query?

    or can I use the standard mechanisms for access to the database, and it will be correct? 

    and how to get from the macro (web control) default connection string to the database?

    and more interested in the question, can after install the package, create a table in the database?

     

    thnks

  • Tommy Poulsen 514 posts 708 karma points
    Jan 28, 2010 @ 21:56
    Tommy Poulsen
    0

    Paul,

    from the API you can use the SqlHelper class - this is what's used by Umbraco to access the umbraco database, e.g. by calling this:

      umbraco.BusinessLogic.Application.SqlHelper.ExecuteReader(sql);

    The umbraco connection string get be reached using

     

     

  • Tommy Poulsen 514 posts 708 karma points
    Jan 28, 2010 @ 22:00
    Tommy Poulsen
    0

    Paul,

    from the API you can use the SqlHelper class - this is what's used by Umbraco to access the umbraco database, e.g. by calling this:

      umbraco.BusinessLogic.Application.SqlHelper.ExecuteReader(sql);

    The umbraco connection string get be reached using

      umbraco.GlobalSettings.DbDSN

    Other connection strings from a normal connection string section in the web.config can be read using ConfigurationManager.ConnectionStrings, e.g.

    if (connections["UmbracoGridViewConnectionString"] != null)
    {
    ConnectString = connections["UmbracoGridViewConnectionString"].
    }

    >Tommy

  • Paul D. 12 posts 32 karma points
    Jan 29, 2010 @ 10:36
    Paul D.
    0

    Thank you, this is exactly what I asked!!!

     

    what about automatic table creation in package?

     

    I need a new table in the database

    and very much like when i install package, umbraco create custom tables in db?

    Umbrako has similar functionality?

    thnks

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Aug 11, 2010 @ 14:26
    Biagio Paruolo
    0

    For a new table you must create with SQL Manager.

    The table must be create into UmbracoDb.

    If you use another db you must create another DSN in web.config

  • Bob Jones 33 posts 54 karma points
    Dec 16, 2011 @ 15:41
    Bob Jones
    0

    so there is a web config in umbracco or do you mean .net. The tutorials cover enough of the basics but for all the videos it has not been made clear to me about how I can create through a database, the alternatives, and how to do it. 

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Dec 17, 2011 @ 15:43
    Biagio Paruolo
    0

    Hi,

    for web.config, I mean Umbraco web.config

     

Please Sign in or register to post replies

Write your reply to:

Draft