Click here to Skip to main content
15,895,142 members

Comments by Member 11545313 (Top 5 by date)

Member 11545313 23-Mar-15 17:23pm View    
Give me an exemple plz i need to handle this
Member 11545313 23-Mar-15 9:21am View    
int a = cmd.ExecuteNonQuery();
Member 11545313 23-Mar-15 7:40am View    
i try it but , he added me all the information in combobox + exeption
(Conversion failed when converting the varchar value 'Money,2015-03-23 ,90min' to data type int.
i want to increase the insertion of field in combobox at runtime
Member 11545313 23-Mar-15 7:24am View    
i'm post it just in this forum think's for advice
Member 11545313 22-Mar-15 10:28am View    
i tried in button added
try
{
cn.Open();
cmd.CommandText = ("insert into film (nom_film,date_sortie,duree)values('" + textBox1.Text+ "','"+this.dateTimePicker1.Text+"','"+textBox3.Text+"')");
cmd.Connection = cn;
cmd.ExecuteNonQuery();

//the problems is inside loop
if (comboBox1.SelectedIndex != 0)
{
this.comboBox1.Items.Add(this.comboBox1.SelectedIndex);
//comboBox1.Refresh();
}

textBox1.Clear();
textBox1.Focus();
textBox3.Clear();
MessageBox.Show("Film Ajouter Avec Succees", "insertion Filme", MessageBoxButtons.OK, MessageBoxIcon.Information);
cn.Close();
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message.ToString());
}