{
dsBatchAssignable ds =new dsBatchAssignable();// Typed dataset with two int
fields
if (mDt.GetAssignableBatches(ds))
{
if ((int)ds.Tables[0].Rows[0].ItemArray[0] ==805) //Proving that table has
been filled.
ds.Tables[0].Rows[0].ItemArray[1] = "3"; //inspection shows System.DBNull
value (expected) before AND AFTER assignment.
if (ds.HasChanges())
MessageBox.Show("Altered"); //Dont get here
}
}
ds.Tables[0].Rows[0].ItemArray[1] = 3 (without quotes, it's an int)
However, it's strongly typed, why don't you use its generated
properties?
--
Ludwig Stuyck
http://www.coders-lab.be
This isn't a typed dataset problem. When you return the ItemArray, it
returns a new array, not the array used internally which is holding the
values.
So you end up modifying the value in the array, not the value in the
dataset.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"Bob" <b...@nowhere.com> wrote in message
news:OANR6Wyf...@TK2MSFTNGP05.phx.gbl...
An assignment statement should either complete properly or error. There is
no middle ground.
I have proved that the value is unchanged by:
Hovering the mouse over the instruction and expanding the 'inpection'
Querying the value in the immediate window.
The wearying thing is that this used to work in VS2003.
I have a project that was migrated from VS2003 to VS2005 and it still works
so it is not as simple as 'Duh! they broke it.'
Unfortunately there are number of differences between the two projects in
the data retrieval area. so it is hard to infer what is causing this.
But getting it going is not as important as explaining why the assignment
statement is inert. This should be an impossibility.
Bob
"Bob" <b...@nowhere.com> wrote in message
news:OANR6Wyf...@TK2MSFTNGP05.phx.gbl...
And what about:
ds.Tables[0].Rows[0][1] = 3;
By the way - and this is not directly related to the original question
- a few days ago I was at a meeting of our user group and Mr Clemens
Vaster did a presentation on WCF. When talking about remoting and
datasets, it came down to the fact that datasets were pure evil.
Would you guys use datasets in some cases?
"Ludwig" <no...@none.com> wrote in message
news:4ri972pjdttpri96u...@4ax.com...
>Hi Ludwig,
>Yep, accessing the cell directly works.
>Thank you.
>So where to from here?
>Do we just carry on or do you agree that it is a bug and should be fixed?
>(I know, I know, life is too short. But...)
>Bob
>
Well, have a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskupdatingexistingrecordsindataset.asp
As you see, Even Microsoft sais that this is te way to do it! And yes,
in MSDN documentation they say: "You can use this property to set or
get values for this row through an array."
But!
I believe that the getter of the property ItemArray returns a copy of
the cell values, not a reference, so you'll get a new array. Changing
that array does not affect the original cell values.
So according to the documentation this seems like a bug.