Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 18th, 2009, 11:25 AM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
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?
  #2 (permalink)  
Old August 18th, 2009, 04:29 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
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...
  #3 (permalink)  
Old August 21st, 2009, 01:01 AM
Authorized User
Points: 198, Level: 3
Points: 198, Level: 3 Points: 198, Level: 3 Points: 198, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2008
Location: singapore, singapore, Singapore.
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)
  #4 (permalink)  
Old August 21st, 2009, 08:45 AM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
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!
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:29 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.