Hi I'm using a method to have my dataTable
public static DataTable excutequery(string query) { try {
SqlDataAdapter sqladapter = new SqlDataAdapter(query ,cnx );
SqlCommandBuilder commandBuilder = new SqlCommandBuilder(sqladapter);
DataTable table = new DataTable();
table.Locale = System.Globalization.CultureInfo.InvariantCulture;
sqladapter.Fill(table);
return table;
}
catch (SqlException e)
{
MessageBox.Show(e.ToString ());
return null;
}
}
that methode retunr for me a DataTable i'm binding a listbox(in WPF) using this DataTable this listBox contain as a templage an image
I'm using a BindingListCollectionView ImageView = (BindingListCollectionView)CollectionViewSource.GetDefaultView(ImageList.DataContext); and i Have to button one for deleting if (ImageView.CurrentPosition > -1) ImageView.RemoveAt(ImageView.CurrentPosition); and the other one to submit changes tablProductImage.AcceptChanges();
he is the problem when I call the AcceptChanges methode nothing is changing? any solution please?