Row Status Dataset

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
 
M

Miha Markic [MVP C#]

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.
 
C

Cor Ligthert [MVP]

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
 
M

Marcus Kraus

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
 
J

Jeff Dillon

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

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top