Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / April 2006

Tip: Looking for answers? Try searching our database.

Prevent rowstate change for one column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carl - 06 Apr 2006 12:21 GMT
Hi!

I have an DataTable with one extra column that I've added manually, and is
not in the database. I use this col for various calculations, and it should
never be saved to the db. That works fine, except for one thing: when I
change the value in a row for that col, the RowState becomes Modified.
That's natural I guess, but it's unneccecary because it sends unmodified
rows to the db. Is there a way of marking a col as "computed" or other
technique to avoid changing the rowstate when changing that columns value?

regards

Carl
Jim Hughes - 06 Apr 2006 13:50 GMT
datarow.AcceptChanges()

> Hi!
>
[quoted text clipped - 10 lines]
>
> Carl
Carl - 06 Apr 2006 14:47 GMT
That is not an option in my case, since there might (will) be other changes
to the row, and I do not wish to accept those changes.

> datarow.AcceptChanges()
>
[quoted text clipped - 12 lines]
>>
>> Carl
Jim Hughes - 06 Apr 2006 19:04 GMT
Then do a test to see If Not dataRow.HasChanges() before accepting them.

> That is not an option in my case, since there might (will) be other
> changes to the row, and I do not wish to accept those changes.
[quoted text clipped - 15 lines]
>>>
>>> Carl

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.