| DotNetFirebird Using Firebird SQL in .NET. |
|
Home
Features
Download
Documentation
FAQ
Tools and Code
About
Blog
|
Saturday, March 05, 2005
Using FbConnectionStringBuilderFirebird ADO.NET provider supports a new class (FbConnectionStringBuilder) that makes the work with connection strings much easier: 1. Parsing a connection string Create a new instance using public FbConnectionStringBuilder(string) constructor (it takes an existing connection string as a parameter). Then you can read the connection string values by using the FbConnectionStringBuilder properties. Example of reading the DataSource (server address) property: FbConnectionStringBuilder csb = new
FbConnectionStringBuilder("User=SYSDBA;Password=masterkey;Database=SampleDatabase.fdb;DataSource=localhost;Charset=NONE;"); 2. Creating a connection string programmatically You can create a connection string by specifying the properties item by item: FbConnectionStringBuilder csb = new FbConnectionString(); 3. Modifying an existing connection string You can also modify an existing connection string without complicated parsing. This example switches the type of server to embedded Firebird: FbConnectionStringBuilder csb = new FbConnectionString(existingConnectionString); Comments:
Is there a way to make the Database=mydatabase.fdb part of the connectionstring relative e.g.
..\..\..\mydatabases\mydatabase.fdb? Blog comments are closed.
Previous
Archives
Copyright © 2005 - 2007 DotNetFirebird |