private void btnImage_Click(object sender, RoutedEventArgs e) { { string constr = "Data Source=localhost;port=3306;Initial Catalog=MyCollege;User Id=root;password=2525"; MySqlConnection con = new MySqlConnection(constr); MySqlCommand cmd = new MySqlCommand("INSERT INTO images(Image) VALUES ('" + dataGrid1.SelectedValue + "')", con); con.Open(); int s1 = cmd.ExecuteNonQuery(); if (s1 > 0) { lbl1.Content = "Image inserted succesfully"; } con.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)