C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » XML »

Min and max


Posted Date: 28 Sep 2009      Posted By: preethi m      Member Level: Silver     Points: 1   Responses: 1



Hi

How to retrieve min and max value of a node(date field) from xml file.


Thanks
Mary.





Responses

Author: Kritika Yadav    28 Sep 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

use this function to find max value and similarly you can find min value


Public Shared Function GetMax(ByVal nodes As XmlNodeList, ByVal columnName As String) As Integer
Try
Dim max_rec As Integer = 0
For Each node As XmlNode In nodes
Dim currentRec As Integer = CType(node.Attributes(columnName).InnerText, Integer)
If (currentRec > max_rec) Then
max_rec = currentRec
End If
Next
Return max_rec
Catch ex As Exception
WriteFile("Error in Carts.GetIdentity(): " + ex.Message)
Return 0
End Try

End Function


Join this campus group
http://www.dotnetspider.com/sites/637/-ecb-aspdotnet.aspx

Happy Programming
Kritika Yadav
Dot Net Help



Post Reply
You must Sign In to post a response.
Next : Execute xml file to copy or delete files from a directory
Previous : Sort date using .xsl
Return to Discussion Forum
Post New Message
Category: XML

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use