Re: .NET 1.1 "System.Data.VersionNotFoundException" - I need a wor

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
> >
> >
> >
> >
>
>
>
.



Relevant Pages

  • Re: Proof that Paul Holland was always wrong about me
    ... there are several posts you have made that have ... this is not anything different for/with you david, so indeed, the ... The difference of opinion between us is your assertion that negative ... I say those negative expressions are a result of their own ...
    (alt.med.fibromyalgia)
  • Re: Brad Guths Credentials
    ... Is it the truth that you and David are sleeping together and mutually ... I'll tell you what lie Brad. ...
    (sci.space.history)
  • Re: Y&R SPOILER
    ... Brad: "There's a game at my place tonight" ... David: ... s the game still on for tonight?" ... my point was that letting such recognizable, soap opera faces go ...
    (rec.arts.tv.soaps.cbs)
  • Re: Modeling question...
    ... David BL wrote: ... expressions) are not themselves represented using relations. ... Just because some syntax doesn't look like a relation doesn't mean that the result isn't defined by relations. ... A relation is a mathematical construction. ...
    (comp.databases.theory)