Jack, check the value of NeedsStatus in the dattable, it sounds like the
edit isn't finished. I don't think AcceptChanges is what you want b/c
you'll lose all of your edits so if you call update afterward you won't have
anything sent back to the db. Are you rerunning the thing altogether or do
you have another function, it'd help if you could show how you were doing
the test.

Signature
W.G. Ryan, eMVP
Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
> I have a DataView set up as following:
>
[quoted text clipped - 16 lines]
>
> What gives? Do I need to do an AcceptChanges?
Jack - 29 Jun 2004 21:31 GMT
> it'd help if you could show how you were doing
> the test.
The following code fragments, with the exception of using a DataRow array
rather than the DataView (result is the same for both) is what I am using.
The btnParcelComplete event sets Current, Prior, and Remption needs status.
If there are no further needs, the entire taxid is flagged as "C" (lhdr is a
DataRow in the twsDS1.twsContractHdr table). The test DataSet initially has
three "I" rows and the count in NoIncompleteTaxIds is accurate. When the btn
is clicked and the conditions meat in MofifyNeeds to reset one of the "I"
rows to "C", the count in NoIncompleteTaxIds should be reduced by 1 (i.e.,
2). Instead, cnt is STILL showing as 3 when lhdr.Cells["NeedsStatus"].Value
= "C" is met. The foreach loop shows two "I" and one "C"... so count should
have been 2 because "C" does not meet the Select criteria.
Code fragments are as follows:
private void btnParcelComplete_Click(object sender, System.EventArgs e)
{
[...]
ModifyNeeds();
}
private void ModifyNeeds()
{
[...]
if ( txtSCurrNeeds.Text != "Y" &&
txtSPriorNeeds.Text != "Y" &&
txtMRedemNeeds.Text != "Y" )
{
lhdr.Cells["Redemption"].Value = "*";
lhdr.Cells["NeedsStatus"].Value = "C";
}
NoIncompleteTaxIds();
}
private bool NoIncompleteTaxIds()
{
string agency = r.AgencyID;
DataRow[] tstRows = twsDS1.twsContractHdr.Select("AgencyID = '" + agency
+ "' AND NeedsStatus = 'I'");
int cnt = tstRows.Length;
foreach (DataRow tst in tstRows)
{
string taxid = tst["TaxId"].ToString();
string status = tst["NeedsStatus"].ToString();
}
txtMIncompleteCnt.Text = cnt.ToString();
if (cnt > 0)
return false;
else
return true;
}
William Ryan eMVP - 29 Jun 2004 22:53 GMT
Is lhdr a Grid? If so, then call .EndEdit. You can verify that it's still
in edit mode by testing for HasChanges...
debug.Assert(mydataSet.HasChanges);
I'm guessing it's comign back as false.
Let me know if not.

Signature
W.G. Ryan MVP Windows - Embedded
http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
> > it'd help if you could show how you were doing
> > the test.
[quoted text clipped - 53 lines]
> return true;
> }
Jack - 29 Jun 2004 23:22 GMT
> Is lhdr a Grid? If so, then call .EndEdit. You can verify that it's still
> in edit mode by testing for HasChanges...
> debug.Assert(mydataSet.HasChanges);
> I'm guessing it's comign back as false.
It's bound to an Infragistics UltraWinGrid... and calling ExitEditMode and
UpdateData on it doesn't seem to make a difference.
What is confusing is the DataTable row column IS showing the expected value
("C") in the test loop so the bound data is being propgated to the
underlying DataSet, it's just not filtering correctly in the Select (It
shouldn't be showing up at all.).
Jack - 30 Jun 2004 14:50 GMT
Never mind... found the problem. Forgot to do call the UpdateData method on
the grid.
Still curious as to why it was showing up as modified in the foreach loop
though. Must be some state nuance in the DataSet table that I don't
understand.
> > Is lhdr a Grid? If so, then call .EndEdit. You can verify that it's
> still
[quoted text clipped - 9 lines]
> underlying DataSet, it's just not filtering correctly in the Select (It
> shouldn't be showing up at all.).