Page 1 of 1

DataLogger?

Posted: Tue Aug 21, 2012 2:56 pm
by charliehbeijer
Can I do anything with a DataLogger besides show it in a TrendViewer? Can I accessthe records of a DataLogger in a script?

Re: DataLogger?

Posted: Tue Aug 21, 2012 3:28 pm
by mark.monroe
You can access the data via a report, export it using an action to a csv file, or directly query the database using SQL. I have attached a project that shows you how to query the databse via a script.

An example of how to create an Excel Report Template and generate a report that queries the database can be found in the samples section of the initial iX Developer startup screen. It is called "Sample_Report".

The action to export the datalogger data to a csv file is under the Database action listing.

Re: DataLogger?

Posted: Tue Aug 21, 2012 4:29 pm
by charliehbeijer
Very nice.

Re: DataLogger?

Posted: Tue Aug 28, 2012 5:43 pm
by charliehbeijer
Using the example file you posted, I have in my script:

using System.Data.SqlServerCe;

I'm getting an error message that SqlServerCe doesn't exist in System.Data.

I try using intellisense. I type "using System.Data.", and intellisense says I have Sql, SqlClient, and SqlTypes, but then if I say

using System.Data.Sql, it says Sql is not part of System.Data!

And no matter what I do, I can't resolve the type "SqlCeConnection" which appears in the example project you posted.

Re: DataLogger?

Posted: Wed Aug 29, 2012 8:02 am
by mark.monroe
You need to add a Reference assembly to your project. If you open up the Script_Database_Export project and go to the Reference Assemblies, you will see that it has one.
Snap 2012-08-29 at 08.00.32.jpg
Snap 2012-08-29 at 08.00.32.jpg (68.5 KiB) Viewed 52851 times

Re: DataLogger?

Posted: Wed Aug 29, 2012 8:49 am
by charliehbeijer
Yes, I went there and clicked "Add", but System.Data.SqlServerCe.dll isn't in the list.

Re: DataLogger?

Posted: Wed Aug 29, 2012 8:54 am
by charliehbeijer
I found the dll under
C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices

Re: DataLogger?

Posted: Mon Sep 03, 2012 6:52 am
by charliehbeijer
The database example works perfectly in simulate, and in the debugger, but crashes to the T7A screen on the flat panel.

In the main screen, if I just add
using System.Data;
using System.Data.SqlServerCe;
using System.IO;
using System.Reflection;

the program runs.

But if I then declare inside the partial class:

private SqlCeConnection m_SqlConnection;

the project won't start. It says: Missing Method Exception

Same thing if I say

private SqlCeConnection m_SqlConnection = null;

I'm picking up System.Data.SqlServerCe from
C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices

Re: DataLogger?

Posted: Tue Sep 04, 2012 9:24 am
by mark.monroe
Below is code that works on my Main screen. I think the issue is that you need to use the system.data.sqlserverce.dll contained in the attached zip file. I tried using the same one you are, and it is not working.

Code: Select all

namespace Neo.ApplicationFramework.Generated
{
    using System.Windows.Forms;
    using System;
    using System.Drawing;
    using Neo.ApplicationFramework.Tools;
    using Neo.ApplicationFramework.Common.Graphics.Logic;
    using Neo.ApplicationFramework.Controls;
    using Neo.ApplicationFramework.Interfaces;
    
	using System.Data;
	using System.Data.SqlServerCe;
	using System.IO;
	using System.Reflection;
    
    public partial class Screen1
    {
		private SqlCeConnection m_SqlConnection;
    }
}