Error: A native exception has occurred in SQLCompact 3.5 under Windows Embedded Compact 7
Hi,I have developed an application using Visual Studio 2008 on C# for stand-alone device, working under Windows Embedded Compact 7. Application work with SQLCompact 3.5 .
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlServerCe;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace TestSQLCompact
{
PublicpartialclassForm1 : Form
{
Publicstring open_db = "Data Source=Test7.sdf";
PublicSqlCeConnection conn;
Publicstring query_list;
public Form1()
{
InitializeComponent();
conn = newSqlCeConnection(open_db);
}
Private void button1_Click(object sender, EventArgs e)
{
try
{
conn.Open();
}
catch (SqlCeException se)
{
return;
}
query_list = "SELECT * FROM Rashod";
DataSet ds = newDataSet();
SqlCeDataAdapter da = newSqlCeDataAdapter(query_list, conn);
da.Fill(ds);
. . .
conn.Close();
}
}
}
I started application under Debugger of Visual Studio 2008 and at string
da.Fill(ds);
I get Error : A native exception has occurred in TestSQLCompact.exe
Detail message:
Error
ExceptionCode: 0xc0000005
Exception Address : 0
Reading: 0
When I made the same application for Windows 7, it is running without any error.
Also I made next steps:
- Added new Ites to Project - seven SQL Server Compact 3.5 DLLs:
sqlceca35.dll , sqlcecompact35.dll , sqlceer35EN.dll , sqlceme35.dll,
sqlceoledb35.dll , sqlceqp35.dll , sqlcese35.dll . - For each of these DLLs in Solution Explorer opened the Properties window.Then set the Copy to Output Directory property to Copy if newer.
- In Solution Explorer expanded Reference node, selectedSystem.Data.SqlServerCe and set the Copy Local property to True.
But result not changed. I searched in other forums, but without result.
1 answer
Good job! I used this on my Christmas Light Installers in Rome GA website!