Re: .NET 1.1 "System.Data.VersionNotFoundException" - I need a wor
- From: David W. Rogers <DavidWRogers@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 31 Dec 2005 20:40:02 -0800
No, I don't think that is a problem, Brad. This code is straight out of David
Sceppa's ADO.NET book (I'm dying to get my hands on the next version!! :-)
Any code that handles strings needs to be able to cope with "", which is the
same object as String.Empty (i.e. in VB, the expression 'String.Empty is ""'
evaluates to True.)
In my case, I think ADO is getting confused about what kind of record
modification it has. Since I can see that everything looks ok in the
DataTable and all of the right RowVersions are in place, I am thinking this
is a coding error in DataAdapter, perhaps related to related tables, but I
have no way to be sure (short of breaking out the assembly skills.)
Mmmm. I wonder if the update that the DataAdapter is doing to save the
identity column after the insert is where the error is happening? I am using
the following technique to retrieve the identity column value:
InsertCommand.CommandText += "; SELECT " + MappingName + "ID =
SCOPE_IDENTITY()"
InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord
David
"Brad Rogers" wrote:
> Im still learning this, so forgive the possible ignorance, is the problem
> the empty "" there? dont these require null to be specified?
>
> I sort of recall something where "" causes or can cause an invalid pointer
> because there is no string content
>
>
> "David W. Rogers" <DavidWRogers@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:47F9BDF1-9AF7-4C55-8659-07B463EA5B6D@xxxxxxxxxxxxxxxx
> > I have three related tables, and I am getting an exception when :
> > ****************
> > Dim dataRows As DataRow() = ds.Tables(MappingName).Select_("",
> > "",DataViewRowState.Added)
> >
> > dataAdapter.Update(dataRows)
> > ******************
> > The exception is:
> > {System.Data.VersionNotFoundException}
> > [System.Data.VersionNotFoundException]:
> > {System.Data.VersionNotFoundException}
> > HelpLink: Nothing
> > InnerException: Nothing
> > Message: "There is no Original data to access."
> > Source: "System.Data"
> > StackTrace: " at System.Data.Common.DbDataAdapter.Update(DataRow[]
> > dataRows, DataTableMapping tableMapping)
> > at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows)
> > at QuiltTrackDB.BaseSql.PersistChanges(DataSet ds, DataRowState
> rowState,
> > SqlConnection conn, SqlTransaction tran) in
> > C:\Projects\QuiltTrack\QuiltTrackDB\BaseSql.vb:line 594
> > at QuiltTrackDB.BaseSql.PersistAllChanges(DataSet ds) in
> > C:\Projects\QuiltTrack\QuiltTrackDB\BaseSql.vb:line 186"
> > TargetSite: {System.Reflection.RuntimeMethodInfo}
> >
> > I think the problem might be that the table that I am trying to insert a
> > record into is the subject of a relational expression column for another
> > table that I am also inserting to in the same transaction, so removing the
> > expressions before persisting is my next attempt at a workaround. but any
> > advice would be appreciated. (This bug was found in 1.1, but it is still
> > there in 2.0)
> >
> > I have to say I am sorely disappointed in MS and what they have NOT
> managed
> > to do over 5 or so years of ADO.NET - which is, to get the features they
> have
> > long documented - expressions and filters, working correctly.
> >
> > David Rogers
> > Fred Hutchinson Cancer Research Center
> >
> >
> >
> >
>
>
>
.
- Follow-Ups:
- Re: .NET 1.1 "System.Data.VersionNotFoundException" - I need a wor
- From: Brad Rogers
- Re: .NET 1.1 "System.Data.VersionNotFoundException" - I need a wor
- Prev by Date: I'd like to programatically move through a table
- Next by Date: Re: Books on ADO.NET 2.0?
- Previous by thread: I'd like to programatically move through a table
- Next by thread: Re: .NET 1.1 "System.Data.VersionNotFoundException" - I need a wor
- Index(es):
Relevant Pages
|