hi
i have developed an desktop application using
vs 2008 language c#
sql server compact 3.5
i have import all necessary dll
System.Data.SqlServerCe.dll
sqlceca35.dll
sqlcecompact35.dll
sqlceer35EN.dll
sqlceme35.dll
sqlceoledb35.dll
sqlceqp35.dll
sqlcese35.dll
and deploy it while it is running without any error on this PC when i install setup on client machine it will do insertion accurately in database.sdf and also retrieve data for autcomplete.
when i want to retrieve data from it to fill combo box or grid
it will generate error "attempted to read write protected memory. this is often an indication that other memory is corrupt"
Note:if i install this setup on some other pc which have vs2008 it will work fine without any error...Will i have to install some other thing also on Client Pc?
i also try to build
in VS2008:
Tools->Options
Debugging->General
uncheck option "Suppress JIT optimization on module load"
but result will be same.
if any one have any idea why this happen and how to deal with situation
Thanks in Advance...
additonal information copied from comment below
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlServerCe;
using System.Data;
using System.Windows.Forms;
using System.IO;
namespace SalePurchase
{
class dataBase
{
private SqlCeDataAdapter ad;
private SqlCeCommand cmd;
private string StringdbFileName=("Data Source=" + System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\sp.sdf").Replace(@"file:\", "");
private SqlCeConnection coon;
public dataBase()
{
coon = new SqlCeConnection(StringdbFileName);
coon.Close();
}
public int ExecuteSQL(string Query)
{
try
{
coon.Open();
cmd = new SqlCeCommand();
cmd.Connection = this.coon;
cmd.CommandText = Query;
return cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
throw ex;
}
finally
{
coon.Close();
}
}
public DataTable GetDataTable(string Query)
{
try
{
coon.Open();
DataTable dt = new DataTable();
cmd = new SqlCeCommand();
cmd.CommandText = Query;
ad = new SqlCeDataAdapter(Query,coon);
ad.Fill(dt);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
coon.Close();
}
}
public void FillComboBox(string Query, string DisplayMember,string ValueMember, ComboBox cmb)
{
try
{
coon.Open();
DataTable dt = new DataTable();
cmd = new SqlCeCommand();
cmd.CommandText = Query;
ad = new SqlCeDataAdapter(Query, coon);
ad.Fill(dt);
cmb.DataSource = dt;
cmb.DisplayMember = DisplayMember;
cmb.ValueMember = ValueMember;
}
catch (Exception ex)
{
throw ex;
}
finally
{
coon.Close();
}
}
}
}