hi,
i work on a csharp application with sql server ce database and i have this code:
private void recherchebtn_Click(object sender, EventArgs e)
{
SqlCeConnection con = new SqlCeConnection();
con.ConnectionString = @" Data source= `|DataDirectory|\Database1.sdf";
try
{
con.Open();
}
catch (Exception ex)
{
MessageBox.Show("connection failed");
}
finally
{
SqlCeDataReader rs;
SqlCeCommand cmd = new SqlCeCommand("SELECT * FROM Condamne where Nom='" + nomTextBox.Text + "'and Prenom='" + prenomTextBox.Text + "'", con);
rs = cmd.ExecuteReader();
SqlCeDataAdapter da = new SqlCeDataAdapter(cmd);
da.Fill(database1DataSet);
con.Close();
dataGridView1.DataSource = database1DataSet.Condamne;
}
}
but this code doesn't work and nothing displayed in the datagridview.
i hope you help me and thanks..