Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX - |
Contents
Index
![]() ![]() |
Part 2 Developing Applications by APIs | > Chapter 10 Developing .NET Applications | > 10.3 How to Use .NET APIs | > 10.3.2 Data Searches |
Sometimes it is desirable to obtain the number of items that match specific search conditions before extracting the actual data.
In this case, use the GetHitCount method to specify the search expression and obtain only the number of hits.
The following diagram shows the process for obtaining the number of XML documents that match specified conditions.
ShunService service = new ShunService(); service.Connect(); int hitCount = service.GetHitCount( "/document/base/prefecture == 'Sydney'" ); (1) Console.WriteLine( "[Number of hits] = {0}", hitCount ); service.Disconnect(); |
Dim service As New ShunService() service.Connect() Dim hitCount As Integer = service.GetHitCount( "/document/base/prefecture == 'Sydney''" ) (1) Console.WriteLine( "[Number of hits] = {0}", hitCount ) service.Disconnect() |
Specify search conditions at the arguments of getHitCount to obtain the number of hits.
Refer to Appendix B Format of Search, Return and Sort Expressions for more information on search expressions.
Contents
Index
![]() ![]() |