Copied to clipboard

Flag this post as spam?

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


  • Dan 1250 posts 3747 karma points admin c-trib
    Jun 23, 2011 @ 17:38
    Dan
    0

    Read table data from SQL CE

    Hi,

    I need to read some data from a simple custom database table and display it in a dashboard widget.  I'm having trouble just establishing the basic connection to the database though, and none of the documentation/snippets I've found seem to work for SQL CE.

    Can anyone point me in the right direction here?

    Thanks

  • Lee Kelleher 3945 posts 15163 karma points MVP 10x admin c-trib
    Jun 23, 2011 @ 18:27
    Lee Kelleher
    0

    Hi Dan,

    Can you not go through the umbraco.DataLayer / SqlHelper APIs? Those will handle the connection to the database, including SQL CE4.

    ... or do you need to target SQL CE4 specifically?

    Cheers, Lee.

  • Dan 1250 posts 3747 karma points admin c-trib
    Jun 24, 2011 @ 11:47
    Dan
    0

    Hi,

    I've got it working without, but I would prefer to use helpers as it would be a lot neater.  Is there any documentation or a tutorial/blog post anywhere which demonstrates this?  The only things I've found I can't get to work, e.g.

    ISqlHelper test = SqlCEHelper.ExecuteScalar<object>("SELECT * FROM myTable;");

    (Error: An object reference is required for the non-static field, method, or property 'umbraco.DataLayer.SqlHelper<System.Data.SqlServerCe.SqlCeParameter>.ExecuteNonQuery(string, params umbraco.DataLayer.IParameter[])')

    Thanks

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies