I have problem regarding insert operation in SQL Server CE, this is the exception
and these are my code :
private void button1_Click(object sender, EventArgs e)
{
try
{
perintahsql = new SqlCeCommand("INSERT INTO lokasi (Campus, Address, Phone 1, Phone 2, Phone 3, Fax, Ext.number, Longitude, Latitude, Maps) VALUES (@Campus, @Address, @Phone 1, @Phone 2, @Phone 3, @Fax, @Ext.number, @Longitude, @Latitude, @Maps)", koneksi);
perintahsql.Parameters.AddWithValue("@Campus", comboBox1.Text);
perintahsql.Parameters.AddWithValue("@Address", textBox1.Text);
perintahsql.Parameters.AddWithValue("@Phone 1", textBox2.Text);
perintahsql.Parameters.AddWithValue("@Phone 2", textBox3.Text);
perintahsql.Parameters.AddWithValue("@Phone 3", textBox4.Text);
perintahsql.Parameters.AddWithValue("@Fax", textBox5.Text);
perintahsql.Parameters.AddWithValue("@Ext. number", textBox6.Text);
perintahsql.Parameters.AddWithValue("@Longitude", textBox7.Text);
perintahsql.Parameters.AddWithValue("@Latitude", textBox8.Text);
perintahsql.Parameters.AddWithValue("@Maps", textBox9.Text);
koneksi.Open();
perintahsql.ExecuteNonQuery();
koneksi.Close();
}
catch (SqlCeException ex)
{
MessageBox.Show("Whoopss!! " + ex, "SQL Server CE Exception Message");
}
}
How to fix that error? Thank you.