Row Status Dataset

  • Thread starter Thread starter Marcus Kraus
  • Start date Start date
M

Marcus Kraus

Hi everybody...

first of all "please excuse my bad english" :-)

I need to control the RowStatus in a Dataset..

e.g. I want to insert a Row in a Dataset which will not be updated when I
uses xxx.Update()......So I want to have this Row to be "Not Modified" and
than I need to Change another Row Status to "Modified" ( I know I can use
xxx.AcceptChanges() but this won't help... )

I have used PowerBuilder Datawindow Technilogie ( from Sybase ) bevore and
it was similiar to the Dataset Datadapter paradigm..... With that we had
full control over the Status....

Can someone help me with that ??


Thousand Thanks
 
Hi Marcus,

If you are on .net 1.x then you can use
a) DataRow.AcceptChanges
b) set some field to itself, like DataRow[0] = DataRow[0]... this will make
row Modified if it was Unchanged before.

If you are on .net 2 then
a) same
b) Use DataRow.Set*() methods.
 
Marcus,

We cannot see what you mean with insert datarow.

However with DataTable.LoadDataRow you can tell how the rowstatus has to be
as it should be.

Why can you not use the datarow acceptchanges by the way.

http://msdn2.microsoft.com/en-us/library/system.data.datarow.acceptchanges.aspx

While there are methods to set the status as setModified

http://msdn2.microsoft.com/en-us/library/system.data.datarow.setmodified.aspx

The last is alone for 2.0 so if it is an olderversion than you should have
to do a trick as changing a field with its own value.

I hope this helps,

Cor
 
Thank you very much for the quick response.. :-)

I meant to insert a new Row and than somehow control the RowStatus... in
some way...

The Answer is very usefull..

Marcus
 
Add a flag field yourself, then don't allow the insert on the server,
perhaps in the insert trigger

Jeff
 
Back
Top