tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

Creating Firebird database programatically (C#/.NET)

20 Apr 2006 1 mins .NET, Firebird

Well, after Creating Firebird database programatically (Delphi) post I’m bringing the example “How to create FB database programatically from .NET?".

The solution is easy too. 😃 You can just use (and also extend) this simple function. It uses the Firebird ADO.NET Data Provider.

static void CreateFBDatabase(string host, string fileName, string user, string password, int pageSize, bool forcedWrites, bool overwrite)
{
	FbConnectionStringBuilder csb = new FbConnectionStringBuilder();
	csb.Database = fileName;
	csb.DataSource = host;
	csb.UserID = user;
	csb.Password = password;
	FbConnection.CreateDatabase(csb.ConnectionString, pageSize, forcedWrites, overwrite);
}

Profile Picture Jiří Činčura is .NET, C# and Firebird expert. He focuses on data and business layers, language constructs, parallelism, databases and performance. For almost two decades he contributes to open-source, i.e. FirebirdClient. He works as a senior software engineer for Microsoft. Frequent speaker and blogger at www.tabsoverspaces.com.