Re: Nasty DataView bug
- From: "Bob L." <nospam.info2@xxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 07:20:43 -0500
I appreciate the response, but that's a tough sell. The row is valid with or
without the filter, so it should remain the same. Obviously the object is
being reloaded with whatever is the first element in the list, but it is
atypical to mess around with an existing object behind the scenes.
The bottom line is that it breaks our application and we need a fix or
workaround. So to say this was "fixed" in 2.0 doesn't get us to our goal!
- Bob
"Sahil Malik [MVP]" <contactmethrumyblog@xxxxxxxxxx> wrote in message
news:uvF8kWJ9FHA.132@xxxxxxxxxxxxxxxxxxxxxxx
> Okay the behavior is inconsistent between 1.1 and 2.0, but truthfully as
the
> RowFilter changes, the Dataview should reflect the changes - and since 12
is
> the first row, the bug is with .NET 1.1, not 2.0.
>
> - Sahil Malik [MVP]
> ADO.NET 2.0 book -
> http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
> --------------------------------------------------------------------------
--
>
> "Bob L." <nospam.info1@xxxxxxxxxxxxxxxxx> wrote in message
> news:%23FpxUIG9FHA.2816@xxxxxxxxxxxxxxxxxxxxxxx
> > Hi, everyone,
> >
> > I ran into a serious bug upgrading to VS2005, and very easy to
reproduce.
> > It
> > goes like this:
> >
> > 1. Filter a DataView
> > 2. Get a reference to a DataRowView
> > 3. Clear the filter - the reference to the DataRowView has changed to a
> > completely different row!
> >
> > This is not a problem in .NET 1.1 - only in 2.0. The code to reproduce
the
> > problem is below. Please help!
> >
> > Thanks,
> > Bob L.
> >
> >
> > Dim oTable As DataTable
> > Dim oView As DataView
> > Dim oRowView As DataRowView
> >
> > 'Build simple table
> > oTable = New DataTable
> > oTable.Columns.Add("ID", GetType(Integer))
> > oTable.Rows.Add(New Object() {12})
> > oTable.Rows.Add(New Object() {25})
> >
> > 'Construct & filter DataView
> > oView = New DataView(oTable)
> > oView.RowFilter = "ID=25"
> >
> > 'Get a reference to the found item and display the ID
> > oRowView = oView.Item(0)
> > MsgBox(oRowView.Item(0)) 'ID = 25
> >
> > oView.RowFilter = ""
> >
> > 'Show the same ID again
> > 'In 1.1 this line of code still shows 25 - correct.
> > 'In 2.0 it shows 12 - wrong!
> > MsgBox(oRowView.Item(0))
> >
> >
>
>
.
- Follow-Ups:
- Re: Nasty DataView bug
- From: Sahil Malik [MVP]
- Re: Nasty DataView bug
- References:
- Nasty DataView bug
- From: Bob L.
- Re: Nasty DataView bug
- From: Sahil Malik [MVP]
- Nasty DataView bug
- Prev by Date: Re: DataAdapter Mapping only works for the first two tables.
- Next by Date: Re: Concurrency Violations in SqlCeDataAdapter
- Previous by thread: Re: Nasty DataView bug
- Next by thread: Re: Nasty DataView bug
- Index(es):
Relevant Pages
|
Loading