string dbfile = "|DataDirectory|\\Database1.sdf";
string insertStmt = "select * from item";
string a = "insert into item(item1,item2) values('3','3')";
SqlCeCommand query,query1;
SqlCeConnection connection;
private void button1_Click(object sender, EventArgs e)
{
connection = new SqlCeConnection("Data Source=" + dbfile);
query = new SqlCeCommand(insertStmt, connection);
{
connection.Open();
query1 = new SqlCeCommand(a, connection);
query1.ExecuteNonQuery();
SqlCeDataReader r = query.ExecuteReader();
while (r.Read())
{
string cjdnc = r[0].ToString();
string kdmckd = r[1].ToString();
}
connection.Close();
}
}
in this code select query works fine
but insert query not inserting data in table item
nd also not showing any error