Problem with DeleteCommand in C#
Hi,
I am setting up a small interface. I have a problem.
I want to create a window in which the future of the software user enter data that could save. My program does not work correctly.
The error that I get is:
Quote:
"Update requires a valid DeleteCommand when crossing the DataRow collection with deleted rows."
I tried several things but nothing works.
Thank you for help.
Re: Problem with DeleteCommand in C#
The code that corresponds to the error generated would be welcome this suppose to be consider if we need to implement the Delete command in C#,and for this strong logic should be there to get properly implemented.
let it be.If you have a code then please show this will help to understand better
Re: Problem with DeleteCommand in C#
Here is the Code:
Code:
public partial class Form1: Form
(
public Form1 ()
(
InitializeComponent ();
)
private void table1BindingNavigatorSaveItem_Click (object sender, EventArgs e)
(
this. Validate ();
this. table1BindingSource. EndEdit ();
this. tableAdapterManager. updateAll (this. database1DataSet1);
)
private void Form1_Load (object sender, EventArgs e)
(
/ / TODO: This line of code loads the data in table 'database1DataSet1.Table1. You can move or delete according to your needs.
this. table1TableAdapter. Fill (this. database1DataSet1. Table1);
)
)
)
Re: Problem with DeleteCommand in C#
At what point it will generate the error? during an update?or an addition? That you forget to mention, and that is important.otherwise on the above it looks pefectly all right.