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.
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[])')
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
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.
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.
(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
is working on a reply...