Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 18th, 2009, 11:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default Need ColumnState function

datatable.rows(n).RowState can be checked to see whether a row in an internal datatable has changed. Is there some way to tell whether a specific column's value for said row has changed without tracking changes as they are made? I was hoping for something like:

table.rows(n)(column).ColumnState

That does not exist, but is there some way to compare the old value for the column against the new column to determine what has changed?
 
Old August 18th, 2009, 04:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Hmmmm...25 reads and no suggestions whatsoever. Guess it can't be done!

For those who want to know, I resolved this by retrieving a copy of the record to be updated prior to updating, and comparing column to column to identify changes. I'm surprised there isn't an easier way...
 
Old August 21st, 2009, 01:01 AM
Authorized User
 
Join Date: Apr 2008
Posts: 54
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Quote:
Originally Posted by Ron Howerton View Post
Hmmmm...25 reads and no suggestions whatsoever. Guess it can't be done!

For those who want to know, I resolved this by retrieving a copy of the record to be updated prior to updating, and comparing column to column to identify changes. I'm surprised there isn't an easier way...
what you can do is

Code:
 
for each MyRow as DataRow in TestTable.Rows
if(MyRow.RowState=Modified)'do your part here to check
response.write(MyRow("TestColumn",OrinalVersion) = MyRow("TestColumn"))
end if
end if
next
the above code is written for understanding only. will not be compiled.
__________________
Pon Saravanan
VbKnowledgebase.com
The Following User Says Thank You to pons_saravanan For This Useful Post:
Ron Howerton (February 22nd, 2013)
 
Old August 21st, 2009, 08:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Thank you very much, pons_saravanan!!!

That's exactly what I needed and it has to be more efficient than another DB call and then comparing two rows! I'd obviously ignored the intellisense previously or I'd have known the column index took two parms.

Thanks again!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Contains Function MargateFan XSLT 2 February 28th, 2008 06:16 PM
send variable in function to another function schoolBoy Javascript How-To 6 March 3rd, 2007 09:16 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
About Next function Tere Crystal Reports 0 April 2nd, 2004 08:47 PM
retreive function/Line from macro or function? MikoMax J2EE 0 April 1st, 2004 04:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.