2011/09/22
[C#] Firebird 연결문자열을 FbConnectionStringBuilder를 이용하여 만들기
Connection Strings을 아래와 같이 문자열로 작업하는 것이 아니라 FbConnectionStringBuilder 객체를 이용하면 좀 더 쉽고 직관적으로 만들 수 있다.
FbConnectionStringBuilder Properties (출처: Firebird .Net Provider SDK 1.7 문서)
<
Original Post : http://neodreamer-dev.tistory.com/580
string connectionString =
"User=SYSDBA;" +
"Password=masterkey;" +
"Database=F:\FirebirdDB\ estdb.fdb;" +
"DataSource=localhost;" +
"Charset=UTF8;" +
"ServerType=0"; // Type: 0 - Server, 1 - Embedded
FbConnectionStringBuilder csb = new FbConnectionStringBuilder();
csb.UserID = "SYSDBA";
csb.Password = "masterkey";
csb.Database = "F:\FirebirdDB\ estdb.fdb";
csb.DataSource = "localhost";
csb.Charset = "UTF8";
csb.ServerType = FbServerType.Default;
// Create Database
FbConnection.CreateDatabase(csb.ToString());
// Create Connection object
FbConnection conFirebird = new FbConnection(csb.ToString());
:
// Drop Database
FbConnection.DropDatabase(csb.ToString());
FbConnectionStringBuilder Properties (출처: Firebird .Net Provider SDK 1.7 문서)
Name | Type | Description |
Charset | string | Gets or sets the connection character set. |
ClientLibrary | string | |
ConnectionLifeTime | int | Gets or sets the lifetime of a connection in the pool. |
ConnectionTimeout | int | Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error. |
ContextConnection | bool | |
Database | string | Gets the name of the actual database or the database to be used when a connection is open. |
DataSource | string | Gets the name of the Firebird Server to which to connect. |
DbCachePages | int | |
Dialect | int | Gets or sets the database dialect. |
Enlist | bool | |
FetchSize | int | Indicates the number of rows that will be fetched at the same time on Read calls into the internal row buffer. |
IsolationLevel | IsolationLevel | Gets or sets the default Isolation Leve for implicit transactions. |
MaxPoolSize | int | Gets or sets the maximun pool size. |
MinPoolSize | int | Gets or sets the minumun pool size. |
PacketSize | int | Gets or sets the size (in bytes) of network packets used to communicate with an instance of Firebird Server. |
Password | string | Gets ort sets the password for the Firebird user account. |
Pooling | bool | Gets or sets the status of the connection pooling. |
Port | int | Gets or sets the port number in the server for establish the connection. |
ReturnRecordsAffected | bool | |
Role | string | Gets or sets the suer role name. |
ServerType | FbServerType | Gets or sets the server type to wich we want to connect. |
UserID | string | Gets or sets the firebird User account for login. |
<
Original Post : http://neodreamer-dev.tistory.com/580
Labels:
Connection String
,
FbConnectionStringBuilder
,
firebird
,
TistoryOldPost
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment