can't update sql table with TableAdapter.Update

Hello all,

I'm unable to update a SQL table in C# 2005. I created a basic form with binding navigator, dataset, tableAdapter, and a BindingSource. I have 3 text boxes on the form to display data from my table. The text boxes are bound to the binding source. I can make changes and they stick until I exit the application. I have a message box tell me how many rows are updated and that seems to work but when I look at my data all of the changes are gone.

I put this code in a button to update the table from the dataset:

privatevoid btnOk_Click(object sender,EventArgs e)
{
this.pIDXBindingSource.EndEdit();
int result = 0;
result =this.pIDXTableAdapter.Update(this.PtDataSet.PIDX);
MessageBox.Show(result.ToString() +" Table has been updated");
}

Here is my form load:
privatevoid MainForm_Load(object sender,EventArgs e)
{
this.pIDXTableAdapter.Fill(this.PtDataSet.PIDX);
}

[1925 byte] By [LangMan] at [2008-2-7]
# 1

Click the build option from your IDE then goto the bin folder and run the exe file from either the release or debug folder. Your data should stick then when you update it.

pxgator at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Visual C# 2005 Express Edition...
# 2

That did the trick. I must have built about 5 different programs, each time I thought I was doing something wrong.

Thanks.

LangMan at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Visual C# 2005 Express Edition...
# 3

Same problem with VBExpress Guided Tour example. Does this mean one cannot test table updating via the debugger?

AlanH-SA at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Visual C# 2005 Express Edition...
# 4
If you attached your database to your project then you should click the mdb file, change the Copy Always to Do Not Copy. Because during run the program is creating a copy in the bin folder.
icemart525 at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Visual C# 2005 Express Edition...