C# Class SampleApp.StockSample

Create a sample database containing some stock prices and perform some basic queries.
ファイルを表示 Open project: ayende/managed-esent

Public Methods

Method Description
Main ( ) : void

Called on program startup.

Private Methods

Method Description
BuyShares ( JET_SESID sesid, JET_TABLEID tableid, string symbol, int shares ) : void

Increment the number of shares.

CreateColumnsAndIndexes ( JET_SESID sesid, JET_TABLEID tableid ) : void

Setup the meta-data for the given table.

CreateDatabase ( string database ) : void

Create a new database. Create the table, columns and indexes.

DeleteStock ( JET_SESID sesid, JET_TABLEID tableid, string symbol ) : void

Delete the stock with the given symbol.

DumpByIndex ( JET_SESID sesid, JET_TABLEID tableid, string index ) : void

Dump all records from the index.

DumpByNamePrefix ( JET_SESID sesid, JET_TABLEID tableid, string namePrefix ) : void

Dump all records from the index whose name has the given prefix.

DumpPriceRange ( JET_SESID sesid, JET_TABLEID tableid, int low, int high ) : void

Dump all records from the index whose price is in the given range.

InsertOneStock ( JET_SESID sesid, JET_TABLEID tableid, string symbol, string name, int price, int sharesOwned ) : void

Insert information about one stock into the table.

The session must already be in a transaction.

IntersectIndexes ( JET_SESID sesid, JET_TABLEID tableid, string fromName, string toName, int lowPrice, int highPrice ) : void

Print records for companies whose name is between firstName and lastName and whose price is between lowPrice and highPrice. This is done by intersecting two different indexes, which can be an efficient way of finding records that meet multiple criteria.

PopulateTable ( JET_SESID sesid, JET_TABLEID tableid ) : void

Populate the stock table with a set of symbols and prices.

PrintAllRecords ( JET_SESID sesid, JET_TABLEID tableid ) : void

Print all rows in the table.

PrintOneRow ( JET_SESID sesid, JET_TABLEID tableid ) : void

Print the current record.

PrintRecordsToEnd ( JET_SESID sesid, JET_TABLEID tableid ) : void

Print records from the current point to the end of the table.

SeekToSymbol ( JET_SESID sesid, JET_TABLEID tableid, string symbol ) : void

Find the record with the given stock symbol.

Method Details

Main() public static method

Called on program startup.
public static Main ( ) : void
return void