Can anyone tell me why this code added automatically by C# does not work? I
can add a record on the form or modify a record, but hitting the save button
does not save changes back to the database table. I can see the chnages to
the dataset as long as the form is still loaded.

private void customerBindingNavigatorSaveItem_Click(object sender, EventArgs
e)
{
this.Validate();
this.customerBindingSource.EndEdit();

this.customerTableAdapter.Update(this.accessTest1DataSet.Customer);

Re: Tableadapter.update not working by Miha

Miha
Sun Jan 28 10:08:16 CST 2007

Chris,

Are Insert/Update/Delete commands on adapter set?

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Chris" <Chris@discussions.microsoft.com> wrote in message
news:DB1EC995-0B9A-4FE3-8812-D7C4B3BAD7DB@microsoft.com...
> Can anyone tell me why this code added automatically by C# does not work?
> I
> can add a record on the form or modify a record, but hitting the save
> button
> does not save changes back to the database table. I can see the chnages to
> the dataset as long as the form is still loaded.
>
> private void customerBindingNavigatorSaveItem_Click(object sender,
> EventArgs
> e)
> {
> this.Validate();
> this.customerBindingSource.EndEdit();
>
> this.customerTableAdapter.Update(this.accessTest1DataSet.Customer);
>


Re: Tableadapter.update not working by Chris

Chris
Sun Jan 28 12:39:01 CST 2007

Miha Markic,
Please excure my ignorance. How do you "set" these methods?


"Miha Markic [MVP C#]" wrote:

> Chris,
>
> Are Insert/Update/Delete commands on adapter set?
>
> --
> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
> RightHand .NET consulting & development www.rthand.com
> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>
> "Chris" <Chris@discussions.microsoft.com> wrote in message
> news:DB1EC995-0B9A-4FE3-8812-D7C4B3BAD7DB@microsoft.com...
> > Can anyone tell me why this code added automatically by C# does not work?
> > I
> > can add a record on the form or modify a record, but hitting the save
> > button
> > does not save changes back to the database table. I can see the chnages to
> > the dataset as long as the form is still loaded.
> >
> > private void customerBindingNavigatorSaveItem_Click(object sender,
> > EventArgs
> > e)
> > {
> > this.Validate();
> > this.customerBindingSource.EndEdit();
> >
> > this.customerTableAdapter.Update(this.accessTest1DataSet.Customer);
> >
>
>

Re: Tableadapter.update not working by Miha

Miha
Sun Jan 28 12:51:28 CST 2007

Hi Chris,

How did you create your adapter?

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Chris" <Chris@discussions.microsoft.com> wrote in message
news:BB943633-0925-4B6D-9E2F-578518FE4EA9@microsoft.com...
> Miha Markic,
> Please excure my ignorance. How do you "set" these methods?
>
>
> "Miha Markic [MVP C#]" wrote:
>
>> Chris,
>>
>> Are Insert/Update/Delete commands on adapter set?
>>
>> --
>> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
>> RightHand .NET consulting & development www.rthand.com
>> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>>
>> "Chris" <Chris@discussions.microsoft.com> wrote in message
>> news:DB1EC995-0B9A-4FE3-8812-D7C4B3BAD7DB@microsoft.com...
>> > Can anyone tell me why this code added automatically by C# does not
>> > work?
>> > I
>> > can add a record on the form or modify a record, but hitting the save
>> > button
>> > does not save changes back to the database table. I can see the chnages
>> > to
>> > the dataset as long as the form is still loaded.
>> >
>> > private void customerBindingNavigatorSaveItem_Click(object sender,
>> > EventArgs
>> > e)
>> > {
>> > this.Validate();
>> > this.customerBindingSource.EndEdit();
>> >
>> > this.customerTableAdapter.Update(this.accessTest1DataSet.Customer);
>> >
>>
>>


Re: Tableadapter.update not working by Chris

Chris
Sun Jan 28 13:31:01 CST 2007

I dragged the data source over to the form and it created all the code.
Funny, I did exactly what I saw in this traning view for binding data on C#
web site. The authors example works, mine does not. The code is same. But
maybe there is a problem in the code genertaed by C# automatically. Not sure.
THis is wierd. And Itried the same thing at work and I am getting the same
result.


"Miha Markic [MVP C#]" wrote:

> Hi Chris,
>
> How did you create your adapter?
>
> --
> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
> RightHand .NET consulting & development www.rthand.com
> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>
> "Chris" <Chris@discussions.microsoft.com> wrote in message
> news:BB943633-0925-4B6D-9E2F-578518FE4EA9@microsoft.com...
> > Miha Markic,
> > Please excure my ignorance. How do you "set" these methods?
> >
> >
> > "Miha Markic [MVP C#]" wrote:
> >
> >> Chris,
> >>
> >> Are Insert/Update/Delete commands on adapter set?
> >>
> >> --
> >> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
> >> RightHand .NET consulting & development www.rthand.com
> >> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
> >>
> >> "Chris" <Chris@discussions.microsoft.com> wrote in message
> >> news:DB1EC995-0B9A-4FE3-8812-D7C4B3BAD7DB@microsoft.com...
> >> > Can anyone tell me why this code added automatically by C# does not
> >> > work?
> >> > I
> >> > can add a record on the form or modify a record, but hitting the save
> >> > button
> >> > does not save changes back to the database table. I can see the chnages
> >> > to
> >> > the dataset as long as the form is still loaded.
> >> >
> >> > private void customerBindingNavigatorSaveItem_Click(object sender,
> >> > EventArgs
> >> > e)
> >> > {
> >> > this.Validate();
> >> > this.customerBindingSource.EndEdit();
> >> >
> >> > this.customerTableAdapter.Update(this.accessTest1DataSet.Customer);
> >> >
> >>
> >>
>
>

RE: Tableadapter.update not working by KerryMoorman

KerryMoorman
Sun Jan 28 15:12:00 CST 2007

Chris,

Could it be that you are actually updating a copy of your database? See:

http://msdn2.microsoft.com/en-us/library/ms246989.aspx

Kerry Moorman


"Chris" wrote:

> Can anyone tell me why this code added automatically by C# does not work? I
> can add a record on the form or modify a record, but hitting the save button
> does not save changes back to the database table. I can see the chnages to
> the dataset as long as the form is still loaded.
>
> private void customerBindingNavigatorSaveItem_Click(object sender, EventArgs
> e)
> {
> this.Validate();
> this.customerBindingSource.EndEdit();
>
> this.customerTableAdapter.Update(this.accessTest1DataSet.Customer);
>

Re: Tableadapter.update not working by Miha

Miha
Sun Jan 28 15:32:08 CST 2007

I guess you'll have to show more code..

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Chris" <Chris@discussions.microsoft.com> wrote in message
news:EE82C4EB-0C4B-4BFF-9353-E13DD3DCF8A3@microsoft.com...
>I dragged the data source over to the form and it created all the code.
> Funny, I did exactly what I saw in this traning view for binding data on
> C#
> web site. The authors example works, mine does not. The code is same. But
> maybe there is a problem in the code genertaed by C# automatically. Not
> sure.
> THis is wierd. And Itried the same thing at work and I am getting the same
> result.
>
>
> "Miha Markic [MVP C#]" wrote:
>
>> Hi Chris,
>>
>> How did you create your adapter?
>>
>> --
>> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
>> RightHand .NET consulting & development www.rthand.com
>> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>>
>> "Chris" <Chris@discussions.microsoft.com> wrote in message
>> news:BB943633-0925-4B6D-9E2F-578518FE4EA9@microsoft.com...
>> > Miha Markic,
>> > Please excure my ignorance. How do you "set" these methods?
>> >
>> >
>> > "Miha Markic [MVP C#]" wrote:
>> >
>> >> Chris,
>> >>
>> >> Are Insert/Update/Delete commands on adapter set?
>> >>
>> >> --
>> >> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
>> >> RightHand .NET consulting & development www.rthand.com
>> >> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>> >>
>> >> "Chris" <Chris@discussions.microsoft.com> wrote in message
>> >> news:DB1EC995-0B9A-4FE3-8812-D7C4B3BAD7DB@microsoft.com...
>> >> > Can anyone tell me why this code added automatically by C# does not
>> >> > work?
>> >> > I
>> >> > can add a record on the form or modify a record, but hitting the
>> >> > save
>> >> > button
>> >> > does not save changes back to the database table. I can see the
>> >> > chnages
>> >> > to
>> >> > the dataset as long as the form is still loaded.
>> >> >
>> >> > private void customerBindingNavigatorSaveItem_Click(object sender,
>> >> > EventArgs
>> >> > e)
>> >> > {
>> >> > this.Validate();
>> >> > this.customerBindingSource.EndEdit();
>> >> >
>> >> > this.customerTableAdapter.Update(this.accessTest1DataSet.Customer);
>> >> >
>> >>
>> >>
>>
>>


RE: Tableadapter.update not working by Chris

Chris
Sun Jan 28 16:25:00 CST 2007

Kerry, you are the man!
Yes, that is exactly was is happening. Thank you!!!!



"Kerry Moorman" wrote:

> Chris,
>
> Could it be that you are actually updating a copy of your database? See:
>
> http://msdn2.microsoft.com/en-us/library/ms246989.aspx
>
> Kerry Moorman
>
>
> "Chris" wrote:
>
> > Can anyone tell me why this code added automatically by C# does not work? I
> > can add a record on the form or modify a record, but hitting the save button
> > does not save changes back to the database table. I can see the chnages to
> > the dataset as long as the form is still loaded.
> >
> > private void customerBindingNavigatorSaveItem_Click(object sender, EventArgs
> > e)
> > {
> > this.Validate();
> > this.customerBindingSource.EndEdit();
> >
> > this.customerTableAdapter.Update(this.accessTest1DataSet.Customer);
> >

Re: Tableadapter.update not working by Otis

Otis
Mon Jan 29 07:24:33 CST 2007

On Sun, 28 Jan 2007 14:25:00 -0800, Chris <Chris@discussions.microsoft.com>
wrote:

>Kerry, you are the man!
>Yes, that is exactly was is happening. Thank you!!!!
>
>
>
>"Kerry Moorman" wrote:
>
>> Chris,
>>
>> Could it be that you are actually updating a copy of your database? See:
>>
>> http://msdn2.microsoft.com/en-us/library/ms246989.aspx
>>
>> Kerry Moorman
>>
>>
>> "Chris" wrote:
>>
>> > Can anyone tell me why this code added automatically by C# does not work? I
>> > can add a record on the form or modify a record, but hitting the save button
>> > does not save changes back to the database table. I can see the chnages to
>> > the dataset as long as the form is still loaded.
>> >
>> > private void customerBindingNavigatorSaveItem_Click(object sender, EventArgs
>> > e)
>> > {
>> > this.Validate();
>> > this.customerBindingSource.EndEdit();
>> >
>> > this.customerTableAdapter.Update(this.accessTest1DataSet.Customer);
>> >

Don't feel bad. Many of us have been confused by this new helpful "feature" of
VS2K5 designed to assist us in the distribution of our applications.

If possible I always leave the Database (Access, SQL Express, etc.) out of the
project until all testing is done and add it just before deployment.

Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com