Btrieve Classes For - ComponentSource

Transcription

Btrieve Classes for .NETVersion 7.00Programming Manual

Table of ContentsTable of Contents .2Product Overview .8Introduction .8Functions New in Version 7.0.8Functions New in Version 6.0.8Functions New in Version 5.0.8Functions New in Version 4.0.9Functions New in Version 3.0.9Functions New in Version 2.0.9Functions New in Version 1.2.9Functions New in Version 1.1.9Two Class Systems .9Supported Languages .10Creatable Applications .10About DDFs.10Data Types .10Data Size .11License Agreement .11User Support .12Limitations of Warranty .12Sales and User Support .13Development.13Installation.15System Requirements .15Setup .15Installed Files.1664-bit Operating System Support .16Registering and un-registering Structure Builder on Windows Vista or later OSs.17Tutorial .18Preparation of the Btrieve Database .18Starting the ASP.NET Project .19Setting of References to the Project .19Name Space Declaration .21WebForm Settings .21Creating the Data Acquisition Code .22Result of Execution .24About the Sample Programs .25Outline .25Referencing BtLib .2564-bit execution of the sample programs .26Structure Builder .27Overview .27How to Start the Structure Builder .28!2

How to Insert Structures .28Structure Builder Restrictions .28Selecting Variable Data Type for Character String Data .29Standalone Structure Builder .32Overview .32How to start standalone structure builder .32Usage .32Note .34Class Library Reference .35Ddf Class .35Overview .35Constructor .35Property .35CodePage .35DDFDir .35FloatSize .36FillSpace .36OwnerName .36SignNibble .36TableCount.36TableNames .37Method .38GetRecord .38Load .38Login.38Logout.38Unload .38Extended Class .39Overview .39Constructor .41Property reference.41IgnoreCase .41Index .41IndexNumber .42Lock .42MaxRecords .42Mode .42ResultCount .42SearchCond.43SkipRecords .43Method reference .43AddField .43Fill.43GetData .44!3

GetDataSet .44GetDataTable .44MoveFirst .45MoveLast .45MoveNext .45MoveTo .45Read .46RecordExists .46Step .46Exception Class .48Overview .48Constructor .49Properties .49BtrieveStatus.49ErrorCode .49Method .49ToString .49Native Class .50Overview .50Constructor .50Property .50Methods .50BtrCall .50BtrCallID .53FixString .53GetBoolean .54GetBytes .54GetDate .55GetDecimal .55GetDouble.56GetInt16 .57GetInt32 .57GetInt64 .58GetSingle .58GetTime .58Trim .59Record Class .60Overview .60Constructor .60Properties .60ColumnCount .60DataFileName .61FileFlag .61Index .61IndexNumber .62!4

IsOpen.62Lock .62NullKeyValue .63OpenMode .63PageSize.63Methods .63ClearData .63Close .64Create .64Delete .64GetBytes .64GetData .65GetDataColumn .66GetDataSet .66GetDataTable .67GetNumOfRecords .68GetPosition .68GetRecordLength.68Open.68Query .69Read .71SetBytes .71SetData.72Step .72Write .72Transaction Class .73Constructor .74Property .74Lock .74Method .74Abort .74Begin.74BeginConCurrent .75End .75Reset .75Appendix-A: Code Samples .76Visual Basic.NET Sample Code .76Sample Code showing the use of IdictionaryEnumerator .77GetDataSet C# Sample .77C# Sample Showing DataBind to DataGrid in WebForm .77Native Class C# Record Scan Sample .78Native Class VB.NET Record Scan Sample .80Native Class C# Insert Sample Code .81Sample for Inputting the Changed parts of the DataSet into the Database .84!5

Native Class C# Sample for Specifying the Data Area in the Structure.85C# Structure Declaring Sample .86Native Class VB.NET Sample for Specifying the Data Area in the Structure .86VB.NET Structure Declaring Sample .88Appendix-B: FAQs (Frequently Asked Questions).89Status 94 at the time of Web execution .89Sample does not operate on a domain controller .89How to delete Structure Builder from VS.NET Add-in Manager .90Structure Builder does not display on Visual Studio Startup .90On re-installing Structure Builder does not display on the Tool Menu .90What is a DDF file? .91I want to place the DDF files and the data files in separate folders .91Running Btrieve 6.15 under Windows 2000 or Windows XP .91The character string field has been declared, but the leading 1 byte seems to be displaced .92Appendix-C: About Data Types .93Appendix-D: Exception Class Error Code Table.94!6

!7

Product OverviewIntroductionBtrieve Classes for .NET are special .NET-language database access support classes for usewith PSQL v9, PSQL Summit v10,PSQL v11,PSQL Vx Server 11 and PSQL v12. ADO.NETand OLE DB are the standard database access layers in .NET, but by offering a class librarythat does not work via these generic software layers, Btrieve Classes for .NET ensure a veryhigh performance that is 3 to 20 times that of these standard classes.Functions New in Version 7.0In Version 7.0, the following functionality has been added:1.2.3.4.5.Support for PSQL v12.Support for PSQL v12 unicode string data types.Visual Studio 2015 support.Added Standalone Structure Builder.Correction of some minor problems and a few improvements.Version 7.0 is backwards compatible with prior versions.Functions New in Version 6.0In Version 6.0, the following functionality has been added:1.2.3.4.5.The library is now .NET framework 4.0 based.Support for PSQL Vx Server 11.Support for Visual Studio 2013.Support for Windows 8.1.Correction of some minor problems and a few improvements.Version 6.0 is backwards compatible with prior versions.Functions New in Version 5.0In Version 5.0, the following functionality has been added:1.2.3.4.Support for PSQL v11 SP3.Support for Visual Studio 2012.Support for Windows 8.Correction of some minor problems and a few improvements.Version 5.0 is backwards compatible with prior versions.!8

Functions New in Version 4.0In Version 4.0, the following functionality has been added:1.2.3.4.Support for PSQL v11.Support for PSQL Summit v10 SP3.Support for Visual Studio 2010.Support for Windows 7.Version 4.0 is backwards compatible with prior versions.Functions New in Version 3.0In Version 3.0, the following functionality has been added:1.2.3.4.Support for PSQL Summit v10.Support for Visual Studio 2008.LINQ support methods have been added to the Record class.64 Bit OS support (Windows Server 2008 64bit, Windows Vista 64bit, Windows Server2003 64bit )Version 3.0 is backwards compatible with prior versions.Functions New in Version 2.0The class library now supports .NET Framework 2.0, and Visual Studio .NET 2005 IDE.Version 2.0 is compatible with prior versions.Functions New in Version 1.2In this version functionality has been added to support the new security functionality inPervasive.SQL V8.5 and above. This includes support for using a Database URI in the Ddfclass constructor and new Login/Logout methods.Functions New in Version 1.1This version features an added function for direct input and output of Btrieve and PSQL datarecord images that utilizes a structure based on the byte alignment control functions offeredby Microsoft .NET. The Native and Record classes support this structure. Furthermore,because the workload involved with declaring this structure to support byte alignment isthought to be very large, the product now includes a structure builder as add-in software foruse with Microsoft Visual Studio .NET that automatically generates this type of structure froma set of DDF files. This version also features support for Visual Studio .NET 2003.Two Class Systems!9

Btrieve Classes for .NET supports two class systems.!DDFThese are new classes that are designed to comply with the .NET Frameworkspecifications. These DDF classes are composed of Record, Extended, Transaction,and Exception classes, etc. They allow easy access to columns and data typeconversion code. These classes allow very high development efficiency for new codingwork.!NativeThe PSQL SDK does not yet offer a method for accessing Btrieve level operationsfrom .NET Managed Code. These Native classes enable access to Btrieve API leveloperations from Managed Code. These classes are particularly suited to cases wherean existing application does not access DDFs or when you wish to migrate existingcode based on the Btrieve API. However, due to the fact that the Btrieve API containsmany parameters and due to the necessity of code for fetching and storing applicationdata from the record buffer, the application can become complicated.Supported LanguagesThe class library is constructed as a Managed Class Library introduced in the .NETFramework. Accordingly, the languages currently supported are Visual Basic .NET, Visual C#,and Managed C . A large number of other languages for which the .NET Frameworkenvironment is a prerequisite are scheduled for release in the future. As the use of theselanguages becomes widespread , it is planned to introduce support for these new languagestoo on a one by one basis.Creatable ApplicationsThis class library enables the creation of the following types of applications that can makeuse of the .NET Framework.!!!Windows applicationsASP.NET Web applications and Web ServicesConsole applicationsAbout DDFsThe DDF, Record, and Extended classes of Btrieve Classes for .NET operate based on DDFinformation. From PSQL’s Control Center, it is possible to define DDFs using the the tabledesigner and table-creating wizard. Note that long metadata ( V2 metadata ) type DDFs arenot supported by this product.Data TypesBtrieve Classes for .NET's Record and Extended classes can be used to convert PSQL datatypes to .NET Framework data types in accordance with the

Btrieve Classes for .NET supports two class systems.! DDF These are new classes that are designed to comply with the .NET Framework specifications. These DDF classes are composed of Record, Extended, Transaction, and Exception classes, etc. They allow easy access to columns and data type conversion code.