Copied to clipboard

Flag this post as spam?

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


  • Fabio Blardone 79 posts 98 karma points
    Jul 29, 2011 @ 12:13
    Fabio Blardone
    0

    Join with SqlHelper

    Hello,

    what's the syntax for join two tables in sqlhelper?

    Fabio

  • Rich Green 2246 posts 4008 karma points
    Jul 29, 2011 @ 14:03
    Rich Green
    0

    Hey Fabio,

    Not sure what you mean? The table joins are done via the SQL.

    Rich

  • Fabio Blardone 79 posts 98 karma points
    Jul 29, 2011 @ 14:56
    Fabio Blardone
    0

    Sorry, perhaps I expressed myself badly.

    I need to execute a reader via sql helper. But i need the data of two tables.

    I used :

    "select * from Table1,Table2 where Table1.id = @id and Table1.foreign = Table2.id "

    but not work.

  • Luke Johnson 61 posts 80 karma points
    Nov 10, 2011 @ 17:00
    Luke Johnson
    0

    In regular XSLT, this works if you have a .NET extension set up:

            <xsl:variable name="name_of_string" select="SQL:GetDataSet('Your-Database-Name',
                    'SELECT columns, from, both, tables, separated, by, commas
                    FROM Table1
                    INNER JOIN Table2
                    ON Table1.id = Table2.id
                    WHERE (set whatever conditions here)
    ', 'name_of_string')"
            />

    Then call your column names in xsl:value-of statements to access the XML data. Eg, <xsl:value-of select = "columns" />

    I haven't used SQL Helper, so I'm sorry if this is irrelevant. But this solution works without SQL Helper.

Please Sign in or register to post replies

Write your reply to:

Draft