![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Weird dataset.getchanges problem Hello there, I have the following code; I do this as a work around for a dataset.haschanges method which doesnt appear to work correctly either For Each dt As DataTable In myDs.Tables If Not dt.GetChanges(DataRowState.Added) Is Nothing Then hasChanges=true If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then hasChanges=true If Not dt.GetChanges(DataRowState.Deleted) Is Nothing Then hasChanges=true Next On some (not all) of my datatables in the dataset, Visual Studio is claming that certain columns do not exist when I hit the first dt.getchanges line. The column that it claimes does not exist are not in the datatable (according to the dataset visualiser) I have tried regenerating my dataset. Does anyone know what could be going on? I cant figure it out...Thank you John |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Weird dataset.getchanges problem John, This sound strange On some (not all) of my datatables in the dataset, Visual Studio is claming that certain columns do not exist when I hit the first dt.getchanges line. The column that it claimes does not exist are not in the datatable (according to the dataset visualiser) The GetChanges creates a real copy of your datatable, I have never seen this, maybe it uses XML serializing behind the scene and then avoid probably empty columns, can you check that? Would be interesting. Cor "John Sheppard" <spam@xxxxxx> schreef in bericht news:g2ace90115q@xxxxxx Quote: > Hello there, > > I have the following code; I do this as a work around for a > dataset.haschanges method which doesnt appear to work correctly either > > For Each dt As DataTable In myDs.Tables > If Not dt.GetChanges(DataRowState.Added) Is Nothing Then > hasChanges=true > If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then > hasChanges=true > If Not dt.GetChanges(DataRowState.Deleted) Is Nothing Then > hasChanges=true > Next > > On some (not all) of my datatables in the dataset, Visual Studio is > claming that certain columns do not exist when I hit the first > dt.getchanges line. The column that it claimes does not exist are not in > the datatable (according to the dataset visualiser) > I have tried regenerating my dataset. > > Does anyone know what could be going on? I cant figure it out...> Thank you > John > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Weird dataset.getchanges problem Thanks cor, I will check that out and report back. Sorry for the delay, it was a long weekend here. John "Cor Ligthert[MVP]" <notmyfirstname@xxxxxx> wrote in message news:B2751449-8232-4891-BBFF-0387D6BEA41A@xxxxxx Quote: > John, > > This sound strange > > On some (not all) of my datatables in the dataset, Visual Studio is > claming > that certain columns do not exist when I hit the first dt.getchanges line. > The column that it claimes does not exist are not in the datatable > (according to the dataset visualiser) > > The GetChanges creates a real copy of your datatable, I have never seen > this, maybe it uses XML serializing behind the scene and then avoid > probably empty columns, can you check that? Would be interesting. > > Cor > > > "John Sheppard" <spam@xxxxxx> schreef in bericht > news:g2ace90115q@xxxxxx Quote: >> Hello there, >> >> I have the following code; I do this as a work around for a >> dataset.haschanges method which doesnt appear to work correctly either >> >> For Each dt As DataTable In myDs.Tables >> If Not dt.GetChanges(DataRowState.Added) Is Nothing Then >> hasChanges=true >> If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then >> hasChanges=true >> If Not dt.GetChanges(DataRowState.Deleted) Is Nothing Then >> hasChanges=true >> Next >> >> On some (not all) of my datatables in the dataset, Visual Studio is >> claming that certain columns do not exist when I hit the first >> dt.getchanges line. The column that it claimes does not exist are not in >> the datatable (according to the dataset visualiser) >> I have tried regenerating my dataset. >> >> Does anyone know what could be going on? I cant figure it out...>> Thank you >> John >> |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Weird dataset.getchanges problem Hi Cor, There are empty columns, but there are also empty columns in datatables that work....that is, I cant see that they directly relate. I don't know why, but if I do a merge into a clean dataset beforehand it works. It's threaded code and the original dataset comes from a baseform. These things shouldnt really matter I dont think but maybe that has something to do with it.For now I'm content to use the workaround below. 'This worked Dim test As New dsBMS test.Merge(myDs) For Each dt As DataTable In test.Tables If Not dt.GetChanges(DataRowState.Added) Is Nothing Then hasChanges=true If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then hasChanges=true If Not dt.GetChanges(DataRowState.Deleted) Is Nothing Then hasChanges=true Next 'This didnt work For Each dt As DataTable In myDs.Tables If Not dt.GetChanges(DataRowState.Added) Is Nothing Then hasChanges=true If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then hasChanges=true If Not dt.GetChanges(DataRowState.Deleted) Is Nothing Then hasChanges=true Next Thanks Cor John "Cor Ligthert[MVP]" <notmyfirstname@xxxxxx> wrote in message news:B2751449-8232-4891-BBFF-0387D6BEA41A@xxxxxx Quote: > John, > > This sound strange > > On some (not all) of my datatables in the dataset, Visual Studio is > claming > that certain columns do not exist when I hit the first dt.getchanges line. > The column that it claimes does not exist are not in the datatable > (according to the dataset visualiser) > > The GetChanges creates a real copy of your datatable, I have never seen > this, maybe it uses XML serializing behind the scene and then avoid > probably empty columns, can you check that? Would be interesting. > > Cor > > > "John Sheppard" <spam@xxxxxx> schreef in bericht > news:g2ace90115q@xxxxxx Quote: >> Hello there, >> >> I have the following code; I do this as a work around for a >> dataset.haschanges method which doesnt appear to work correctly either >> >> For Each dt As DataTable In myDs.Tables >> If Not dt.GetChanges(DataRowState.Added) Is Nothing Then >> hasChanges=true >> If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then >> hasChanges=true >> If Not dt.GetChanges(DataRowState.Deleted) Is Nothing Then >> hasChanges=true >> Next >> >> On some (not all) of my datatables in the dataset, Visual Studio is >> claming that certain columns do not exist when I hit the first >> dt.getchanges line. The column that it claimes does not exist are not in >> the datatable (according to the dataset visualiser) >> I have tried regenerating my dataset. >> >> Does anyone know what could be going on? I cant figure it out...>> Thank you >> John >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Weird - Very weird annoying problem | General Discussion | |||
| weird problem | Vista General | |||
| weird problem | Vista General | |||
| weird problem | Vista performance & maintenance | |||
| weird problem | Vista General | |||