String InsertImgTableCommand = "INSERT INTO ImageTable (CodImage,NameImage,Image,Distance,Split,Energy,Contrast,Entropy,Omogenity,Variance) VALUES(@CodImage, @NameImage,@Image,@Distance,@Split,@Energy,@Contrast,@Entropy,@Omogenity,@Variance )";
SqlCommand sqlc = new SqlCommand(InsertImgTableCommand, sqlconn);
sqlc.Parameters.AddWithValue("@CodImage", codimg.ToString());
sqlc.Parameters.AddWithValue("@NumeImage", name);
sqlc.Parameters.AddWithValue("@Image", image.ToArray());
sqlc.Parameters.AddWithValue("@Distance", distance);
sqlc.Parameters.AddWithValue("@Split", 1);
sqlc.Parameters.AddWithValue("@Energy", ai.Get_energy());
sqlc.Parameters.AddWithValue("@Contrast", ai.Get_contrast());
sqlc.Parameters.AddWithValue("@Entropy", ai.Get_entropy());
sqlc.Parameters.AddWithValue("@Omogenity", ai.Get_omogenity());
sqlc.Parameters.AddWithValue("@Variance", ai.Get_variance());
sqlconn.Open();
try
{
sqlc.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
sqlconn.Close();
}
I managed to find the error and its in the insert command. And is should`ve been like this