Firebird data Provider for. NET Connection Firebird Database file
- Download Firebird Embedded database: FIREBIRD-2.5.0.25920-0_WIN32_EMBED_PDB_RC2 (zip format, 8.5MB) extract to Local disk, no installation required.
- Create a database with Visual Database management tools: Firebird's database management tools have many, I use the Ibmanager, only one EXE file, free installation.
- The directory where the metabase files are located: Copy all the contents of files Firebird.msg and Intl, UDF two subdirectories from the 1th step to the directory where the database files are placed. Note: Database files can be placed on any accessible directory, not the same directory as the application.
- Configure the application directory: from the 1th step extracted from the directory under the copy file below 6 files to the application directory: Fbembed.dll, firebird.conf, Ib_util.dll, Icudt30.dll, Icuin30.dll, Icuuc30.dll.
- DLL referencing Firebird. NET Provider: First download firebird.net Provider v2.5.1 (zip format, 200KB), unzip, will be FIREBIRDSQL.DATA.FIREBIRDCLIENT.D ll add references to the project.
- Connection: The individual can not remember the connection string, directly using Fbconnectionstringbuilder to create the connection string, the code is as follows:
- The user name is specified as: SYSDBA, otherwise an exception with insufficient permissions may be thrown.
Connection code
usingFirebirdSql.Data.FirebirdClient; Fbconnectionstringbuilder Connbuilder=NewFbconnectionstringbuilder (); Connbuilder.userid= "SYSDBA";//sets a value that the embedded version does not validate the user name. Connbuilder.servertype = fbservertype.embedded;//set the database type to embedded;Connbuilder.database = DBFile;//directory of database files;using(Fbconnection Fbconn =Newfbconnection (connbuilder.connectionstring)) {Fbconn.open (); Console.WriteLine ("Connection Successful! "); Fbconn.close (); }
C # Connection Firebird method