|
|
|
start date: Tue, 21 Aug 2007 13:56:33 -0400,
posted on: microsoft.public.dotnet.languages.vb.data
back
| Thread Index |
|
1
C a r l o s A n t o n i o carlvazpr?arrobayahoo.com
|
|
2
Steve
|
|
3
Kerry Moorman
|
|
4
Steve
|
|
5
Kerry Moorman
|
|
6
Steve
|
|
7
Kerry Moorman
|
|
8
Cor Ligthert[MVP]
|
|
9
Cor Ligthert[MVP]
|
|
10
Cor Ligthert[MVP]
|
Update datarow in typed dataset
Hello,
How can I update a datarow in a typed dataset? It seems i can't make it to
write the changes into the database. What am i doing wrong? Thanks in
advance.
Here's my code:
Private Sub save_changes(ByVal _infraction_id As System.Guid)
Dim o_adapter As New roswellDataSetTableAdapters.infractionsTableAdapter
Dim o_data_table As roswellDataSet.infractionsDataTable
Dim o_row As roswellDataSet.infractionsRow
o_data_table = o_adapter.GetData
o_row = o_data_table.FindByinfraction_id(_infraction_id)
With o_row
..BeginEdit()
.ticket_number = "333"
.EndEdit()
.AcceptChanges()
End With
o_adapter.Update(o_data_table)
o_data_table.AcceptChanges()
End Sub
Date:Tue, 21 Aug 2007 13:56:33 -0400
Author:
|
Re: Update datarow in typed dataset
Remove the calls to AcceptChanges(), both on the row and the table. It's
only needed after the Update(), and even then, it's automatically
"accepted".
Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA
C a r l o s A n t o n i o wrote:
> Hello,
>
> How can I update a datarow in a typed dataset? It seems i can't make it to
> write the changes into the database. What am i doing wrong? Thanks in
> advance.
>
> Here's my code:
>
> Private Sub save_changes(ByVal _infraction_id As System.Guid)
>
> Dim o_adapter As New roswellDataSetTableAdapters.infractionsTableAdapter
>
> Dim o_data_table As roswellDataSet.infractionsDataTable
>
> Dim o_row As roswellDataSet.infractionsRow
>
>
>
> o_data_table = o_adapter.GetData
>
> o_row = o_data_table.FindByinfraction_id(_infraction_id)
>
>
>
> With o_row
>
> ..BeginEdit()
>
> .ticket_number = "333"
>
> .EndEdit()
>
> .AcceptChanges()
>
> End With
>
>
>
> o_adapter.Update(o_data_table)
>
> o_data_table.AcceptChanges()
>
> End Sub
>
>
Date:Tue, 21 Aug 2007 14:31:17 -0400
Author:
|
RE: Update datarow in typed dataset
C a r l o s,
Don't call AcceptChanges on the datarow.
Kerry Moorman
"C a r l o s A n t o n i o >" wrote:
> Hello,
>
> How can I update a datarow in a typed dataset? It seems i can't make it to
> write the changes into the database. What am i doing wrong? Thanks in
> advance.
>
> Here's my code:
>
> Private Sub save_changes(ByVal _infraction_id As System.Guid)
>
> Dim o_adapter As New roswellDataSetTableAdapters.infractionsTableAdapter
>
> Dim o_data_table As roswellDataSet.infractionsDataTable
>
> Dim o_row As roswellDataSet.infractionsRow
>
>
>
> o_data_table = o_adapter.GetData
>
> o_row = o_data_table.FindByinfraction_id(_infraction_id)
>
>
>
> With o_row
>
> ..BeginEdit()
>
> .ticket_number = "333"
>
> .EndEdit()
>
> .AcceptChanges()
>
> End With
>
>
>
> o_adapter.Update(o_data_table)
>
> o_data_table.AcceptChanges()
>
> End Sub
>
>
>
Date:Tue, 21 Aug 2007 11:36:03 -0700
Author:
|
Re: Update datarow in typed dataset
Remove the calls to AcceptChanges(), both on the row and the table. It's
only needed after the Update(), and even then, it's automatically
"accepted".
Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA
C a r l o s A n t o n i o wrote:
> Hello,
>
> How can I update a datarow in a typed dataset? It seems i can't make it to
> write the changes into the database. What am i doing wrong? Thanks in
> advance.
>
> Here's my code:
>
> Private Sub save_changes(ByVal _infraction_id As System.Guid)
>
> Dim o_adapter As New roswellDataSetTableAdapters.infractionsTableAdapter
>
> Dim o_data_table As roswellDataSet.infractionsDataTable
>
> Dim o_row As roswellDataSet.infractionsRow
>
>
>
> o_data_table = o_adapter.GetData
>
> o_row = o_data_table.FindByinfraction_id(_infraction_id)
>
>
>
> With o_row
>
> ..BeginEdit()
>
> .ticket_number = "333"
>
> .EndEdit()
>
> .AcceptChanges()
>
> End With
>
>
>
> o_adapter.Update(o_data_table)
>
> o_data_table.AcceptChanges()
>
> End Sub
>
>
Date:Tue, 21 Aug 2007 14:31:17 -0400
Author:
|
RE: Update datarow in typed dataset
C a r l o s,
Don't call AcceptChanges on the datarow.
Kerry Moorman
"C a r l o s A n t o n i o >" wrote:
> Hello,
>
> How can I update a datarow in a typed dataset? It seems i can't make it to
> write the changes into the database. What am i doing wrong? Thanks in
> advance.
>
> Here's my code:
>
> Private Sub save_changes(ByVal _infraction_id As System.Guid)
>
> Dim o_adapter As New roswellDataSetTableAdapters.infractionsTableAdapter
>
> Dim o_data_table As roswellDataSet.infractionsDataTable
>
> Dim o_row As roswellDataSet.infractionsRow
>
>
>
> o_data_table = o_adapter.GetData
>
> o_row = o_data_table.FindByinfraction_id(_infraction_id)
>
>
>
> With o_row
>
> ..BeginEdit()
>
> .ticket_number = "333"
>
> .EndEdit()
>
> .AcceptChanges()
>
> End With
>
>
>
> o_adapter.Update(o_data_table)
>
> o_data_table.AcceptChanges()
>
> End Sub
>
>
>
Date:Tue, 21 Aug 2007 11:36:03 -0700
Author:
|
Re: Update datarow in typed dataset
Remove the calls to AcceptChanges(), both on the row and the table. It's
only needed after the Update(), and even then, it's automatically
"accepted".
Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA
C a r l o s A n t o n i o wrote:
> Hello,
>
> How can I update a datarow in a typed dataset? It seems i can't make it to
> write the changes into the database. What am i doing wrong? Thanks in
> advance.
>
> Here's my code:
>
> Private Sub save_changes(ByVal _infraction_id As System.Guid)
>
> Dim o_adapter As New roswellDataSetTableAdapters.infractionsTableAdapter
>
> Dim o_data_table As roswellDataSet.infractionsDataTable
>
> Dim o_row As roswellDataSet.infractionsRow
>
>
>
> o_data_table = o_adapter.GetData
>
> o_row = o_data_table.FindByinfraction_id(_infraction_id)
>
>
>
> With o_row
>
> ..BeginEdit()
>
> .ticket_number = "333"
>
> .EndEdit()
>
> .AcceptChanges()
>
> End With
>
>
>
> o_adapter.Update(o_data_table)
>
> o_data_table.AcceptChanges()
>
> End Sub
>
>
Date:Tue, 21 Aug 2007 14:31:17 -0400
Author:
|
RE: Update datarow in typed dataset
C a r l o s,
Don't call AcceptChanges on the datarow.
Kerry Moorman
"C a r l o s A n t o n i o >" wrote:
> Hello,
>
> How can I update a datarow in a typed dataset? It seems i can't make it to
> write the changes into the database. What am i doing wrong? Thanks in
> advance.
>
> Here's my code:
>
> Private Sub save_changes(ByVal _infraction_id As System.Guid)
>
> Dim o_adapter As New roswellDataSetTableAdapters.infractionsTableAdapter
>
> Dim o_data_table As roswellDataSet.infractionsDataTable
>
> Dim o_row As roswellDataSet.infractionsRow
>
>
>
> o_data_table = o_adapter.GetData
>
> o_row = o_data_table.FindByinfraction_id(_infraction_id)
>
>
>
> With o_row
>
> ..BeginEdit()
>
> .ticket_number = "333"
>
> .EndEdit()
>
> .AcceptChanges()
>
> End With
>
>
>
> o_adapter.Update(o_data_table)
>
> o_data_table.AcceptChanges()
>
> End Sub
>
>
>
Date:Tue, 21 Aug 2007 11:36:03 -0700
Author:
|
Re: Update datarow in typed dataset
Carlos,
To explain what acceptchanges does.
It is probably one of the most confusing words Microsoft ever made for a
method. (We see your problem here thousands times).
"Acceptchanges" is needed when you don't update the datatable to the
database using a dataadapter, or update a copy of the datatable and than
have to set the changes as updated in the original datatable.
Standard are only rows updated by a dataadapter which changes the updated
rows to done and removes all the information about the previous state (It is
set with the changes in it as the new changes to not changed).
I am always currious what brainwave the team had who invented this word for
this. It was in Redmond, there drugs are not as free as here I understood,
so the change it was that, is low.
Cor
..
"C a r l o s A n t o n i o >" <carlvazpr?arrobayahoo.com> schreef in
bericht news:%23w0nhyB5HHA.1204@TK2MSFTNGP03.phx.gbl...
> Hello,
>
> How can I update a datarow in a typed dataset? It seems i can't make it
> to write the changes into the database. What am i doing wrong? Thanks in
> advance.
>
> Here's my code:
>
> Private Sub save_changes(ByVal _infraction_id As System.Guid)
>
> Dim o_adapter As New roswellDataSetTableAdapters.infractionsTableAdapter
>
> Dim o_data_table As roswellDataSet.infractionsDataTable
>
> Dim o_row As roswellDataSet.infractionsRow
>
>
>
> o_data_table = o_adapter.GetData
>
> o_row = o_data_table.FindByinfraction_id(_infraction_id)
>
>
>
> With o_row
>
> .BeginEdit()
>
> .ticket_number = "333"
>
> .EndEdit()
>
> .AcceptChanges()
>
> End With
>
>
>
> o_adapter.Update(o_data_table)
>
> o_data_table.AcceptChanges()
>
> End Sub
>
>
Date:Wed, 22 Aug 2007 06:17:57 +0200
Author:
|
Re: Update datarow in typed dataset
Carlos,
To explain what acceptchanges does.
It is probably one of the most confusing words Microsoft ever made for a
method. (We see your problem here thousands times).
"Acceptchanges" is needed when you don't update the datatable to the
database using a dataadapter, or update a copy of the datatable and than
have to set the changes as updated in the original datatable.
Standard are only rows updated by a dataadapter which changes the updated
rows to done and removes all the information about the previous state (It is
set with the changes in it as the new changes to not changed).
I am always currious what brainwave the team had who invented this word for
this. It was in Redmond, there drugs are not as free as here I understood,
so the change it was that, is low.
Cor
..
"C a r l o s A n t o n i o >" <carlvazpr?arrobayahoo.com> schreef in
bericht news:%23w0nhyB5HHA.1204@TK2MSFTNGP03.phx.gbl...
> Hello,
>
> How can I update a datarow in a typed dataset? It seems i can't make it
> to write the changes into the database. What am i doing wrong? Thanks in
> advance.
>
> Here's my code:
>
> Private Sub save_changes(ByVal _infraction_id As System.Guid)
>
> Dim o_adapter As New roswellDataSetTableAdapters.infractionsTableAdapter
>
> Dim o_data_table As roswellDataSet.infractionsDataTable
>
> Dim o_row As roswellDataSet.infractionsRow
>
>
>
> o_data_table = o_adapter.GetData
>
> o_row = o_data_table.FindByinfraction_id(_infraction_id)
>
>
>
> With o_row
>
> .BeginEdit()
>
> .ticket_number = "333"
>
> .EndEdit()
>
> .AcceptChanges()
>
> End With
>
>
>
> o_adapter.Update(o_data_table)
>
> o_data_table.AcceptChanges()
>
> End Sub
>
>
Date:Wed, 22 Aug 2007 06:17:57 +0200
Author:
|
Re: Update datarow in typed dataset
Carlos,
To explain what acceptchanges does.
It is probably one of the most confusing words Microsoft ever made for a
method. (We see your problem here thousands times).
"Acceptchanges" is needed when you don't update the datatable to the
database using a dataadapter, or update a copy of the datatable and than
have to set the changes as updated in the original datatable.
Standard are only rows updated by a dataadapter which changes the updated
rows to done and removes all the information about the previous state (It is
set with the changes in it as the new changes to not changed).
I am always currious what brainwave the team had who invented this word for
this. It was in Redmond, there drugs are not as free as here I understood,
so the change it was that, is low.
Cor
..
"C a r l o s A n t o n i o >" <carlvazpr?arrobayahoo.com> schreef in
bericht news:%23w0nhyB5HHA.1204@TK2MSFTNGP03.phx.gbl...
> Hello,
>
> How can I update a datarow in a typed dataset? It seems i can't make it
> to write the changes into the database. What am i doing wrong? Thanks in
> advance.
>
> Here's my code:
>
> Private Sub save_changes(ByVal _infraction_id As System.Guid)
>
> Dim o_adapter As New roswellDataSetTableAdapters.infractionsTableAdapter
>
> Dim o_data_table As roswellDataSet.infractionsDataTable
>
> Dim o_row As roswellDataSet.infractionsRow
>
>
>
> o_data_table = o_adapter.GetData
>
> o_row = o_data_table.FindByinfraction_id(_infraction_id)
>
>
>
> With o_row
>
> .BeginEdit()
>
> .ticket_number = "333"
>
> .EndEdit()
>
> .AcceptChanges()
>
> End With
>
>
>
> o_adapter.Update(o_data_table)
>
> o_data_table.AcceptChanges()
>
> End Sub
>
>
Date:Wed, 22 Aug 2007 06:17:57 +0200
Author:
|
|
|