I have seen this--when I call Read before HasRows or bind the rowset to a
complex bound control.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit
www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
[quoted text, click to view] "Mike G Burton" <Mike G Burton@discussions.microsoft.com> wrote in message
news:2D975FA1-C248-4E56-8470-D424FF28E7FF@microsoft.com...
>I have a (third-party) grid bound to a dataset for display purposes, but
> during the operation in question I'm directly updating the dataset from my
> application code. When I call HasChanges on the dataset, I get False if
> the
> dataset has a single row, but True if the dataset has multiple rows. Has
> anyone seen this behaviour, and is there a workaround?
>
> Thanks,
> mgb
Details, details, .....
private void timer_Tick(object sender, EventArgs e)
{
if (dsNonMembers.HasChanges())
{
SetButtons(true);
}
else
{
if (bsNonMembers.Count > 0)
{
if
(((DataRowView)bsNonMembers.Current).Row.HasVersion(DataRowVersion.Proposed))
{
SetButtons(true);
}
}
}
}
EndEdit writes the changes to the dataset. With one row, you have to peek.
If a Proposed is found, call EndEdit on the underlying binding source and
the write your changes back to the database.
[quoted text, click to view] "Mike G Burton" <Mike G Burton@discussions.microsoft.com> wrote in message
news:2D975FA1-C248-4E56-8470-D424FF28E7FF@microsoft.com...
>I have a (third-party) grid bound to a dataset for display purposes, but
> during the operation in question I'm directly updating the dataset from my
> application code. When I call HasChanges on the dataset, I get False if
> the
> dataset has a single row, but True if the dataset has multiple rows. Has
> anyone seen this behaviour, and is there a workaround?
>
> Thanks,
> mgb
EndEdit() (called on the table) worked like a charm; I needed to GetChanges()
so checking for proposed changes unfortunately wasn't sufficient. EndEdit
doesn't seem to cause any issues regardless of row state, so I'm content with
just calling it directly within the operation for now.
Much appreciated!
MGB
[quoted text, click to view] "Jim Rand" wrote:
> Details, details, .....
>
> private void timer_Tick(object sender, EventArgs e)
> {
> if (dsNonMembers.HasChanges())
> {
> SetButtons(true);
> }
> else
> {
> if (bsNonMembers.Count > 0)
> {
> if
> (((DataRowView)bsNonMembers.Current).Row.HasVersion(DataRowVersion.Proposed))
> {
> SetButtons(true);
> }
> }
> }
> }
>
> EndEdit writes the changes to the dataset. With one row, you have to peek.
> If a Proposed is found, call EndEdit on the underlying binding source and
> the write your changes back to the database.
>
>
> "Mike G Burton" <Mike G Burton@discussions.microsoft.com> wrote in message
> news:2D975FA1-C248-4E56-8470-D424FF28E7FF@microsoft.com...
> >I have a (third-party) grid bound to a dataset for display purposes, but
> > during the operation in question I'm directly updating the dataset from my
> > application code. When I call HasChanges on the dataset, I get False if
> > the
> > dataset has a single row, but True if the dataset has multiple rows. Has
> > anyone seen this behaviour, and is there a workaround?
> >
> > Thanks,
> > mgb
>
>
Don't see what you're looking for? Try a search.