I cannot see the added data in the data table this is the code:
I'm using Visual Studio 2010 Express.
private void button1_Click(object sender, EventArgs e)
{
string t1 = textBox1.Text;
SqlCeConnection conn =
new SqlCeConnection(@"Data Source=|DataDirectory|\Database1.sdf");
conn.Open();
SqlCeCommand cmdInsert = conn.CreateCommand();
cmdInsert.CommandText = "INSERT TO table_name (Column1) VALUES (t1)";
cmdInsert.ExecuteNonQuery();
conn.Close();
}
It doesn't insert into data table after clicking on the button, it gives me an error on
cmdInsert.ExecuteNonQuery();
it debugs it, but when I click on the button, it shows me an error saying
SqlCeException was unhandled. There was an error parsing the query. [ Token line number = 1,Token line offset = 8,Token in error = TO ]