hi,
i'm working on windows application and sql serverCE database i write this code:
private void enregistrerBtn_Click(object sender, EventArgs e)
{
if (!exist)
{
SqlCeConnection conn = new SqlCeConnection();
conn.ConnectionString = @" Data source= |DataDirectory|\Database1.sdf";
try
{
conn.Open();
}
catch (Exception ex)
{
MessageBox.Show(" connexion failure");
}
finally
{
int r;
System.Data.SqlServerCe.SqlCeCommand cmd1 = new System.Data.SqlServerCe.SqlCeCommand ("INSERT INTO Condamne(Nom,Prenom,AnneeJugee,LieuNaissance,NomPere,NomPrenomMere,LieuResidence,SituationFamiliale,NomFrançais,PrenomFrançais)VALUES('" + nomTextBox.Text + "','" + prenomTextBox.Text + "','" + dateJugementTextBox.Text+"','"+LieuNaissanceTextBox.Text+"','"+prenomPereTextBox.Text+"','"+nomMereTextBox.Text+"','"+lieuResidenceTextBox.Text+"','"+sit uationFamilialeComboBox.Text+"','"+nomFrançaisTextBox.Text+"','"+prenomFra nçaisTextBox.Text+ "');", conn);
r = cmd1.ExecuteNonQuery();
MessageBox.Show(" add operation success");
}
conn.Close();
}
}
my problem is that when i execute this code the operation of inserting in the " condamne" table is successfully. but when i do an operation of search of this new person added in the table i don't find it.
i hope you can help me and execuse my bad english