Home All Groups Group Topic Archive Search About

Dataset.HasChangesmethod ?

Author
18 Jul 2006 11:20 AM
Peter Newman
I have a problem i donr seem to be able to find a soloution to

i have created a dataset, binded the controls to it,  set primary keys
managed to set up navigation through the table
and even search for a value and move to that record.  I have now come to an
abrupt halt with something i thought would be simple ..
updating records.

I have tried using the  Client_RS.HasChanges(DataRowState.Modified) function
( Client_Rs being my Dataset )
but im not getting the expected result.

If make changes in the strCompanyName textbox, and check to see if the
Client_RS.HasChanges is true  it isnt its still false, however if i move to
the next row and back again then the Client_RS.HasChanges is true.  How can i
get tha Client_RS.HasChanges to return true as soon as the data is entered ? 

' Binding Method
        ' Company Name
        strCompanyName.DataBindings.Add(New Binding("Text", Client_RS,
"TBL_ClientAdmin.CompanyName"))

any ideas please

Author
18 Jul 2006 11:44 AM
Cor Ligthert [MVP]
Peter,

You can try the endcurrentedit method.
That is to push data into the datasource without changing the current
position.

http://msdn2.microsoft.com/en-us/library/system.windows.forms.currencymanager.endcurrentedit.aspx

(By the way, using RS in an abbrivation for a DataSet is very misleading in
my idea, a DataSet is a wrapper around DataTables, which is the most to
compare with a classic RecordSet)

I hope this helps,

Cor

Show quoteHide quote
"Peter Newman" <PeterNew***@discussions.microsoft.com> schreef in bericht
news:8625CDCA-B312-4F51-A3DE-5BAD8B1A6B14@microsoft.com...
>
> I have a problem i donr seem to be able to find a soloution to
>
> i have created a dataset, binded the controls to it,  set primary keys
> managed to set up navigation through the table
> and even search for a value and move to that record.  I have now come to
> an
> abrupt halt with something i thought would be simple ..
> updating records.
>
> I have tried using the  Client_RS.HasChanges(DataRowState.Modified)
> function
> ( Client_Rs being my Dataset )
> but im not getting the expected result.
>
> If make changes in the strCompanyName textbox, and check to see if the
> Client_RS.HasChanges is true  it isnt its still false, however if i move
> to
> the next row and back again then the Client_RS.HasChanges is true.  How
> can i
> get tha Client_RS.HasChanges to return true as soon as the data is entered
> ?
>
> ' Binding Method
>        ' Company Name
>        strCompanyName.DataBindings.Add(New Binding("Text", Client_RS,
> "TBL_ClientAdmin.CompanyName"))
>
> any ideas please