Error connecting to Firebird Dataabase with DataAbstract 10.0.0.1521 .NETCore

Hello,
I’ve recently been working on an upgrade of a .NET 4.8 App server going to .NET 8. So far so good. When I attempt to build it, I get an error: “{“FB.NET: Database driver assembly not configured”}”

        private static void SetDAConnection()
        {
            try
            {
                string sConnStr = "FB.NET?" + DBConnection.CreateConnString();
                //System.Windows.Forms.MessageBox.Show(sConnStr);
                ConnectionManager cm = new ConnectionManager();
                if (!RemObjects.DataAbstract.Server.Configuration.Loaded)
                {
                    RemObjects.DataAbstract.Server.Configuration.Load();
                }

                cm.AddDefinition("ChronicleProduction", sConnStr, true);

                cm.DefaultConnectionDefinition.ConnectionType = "FirebirdClient ADO.NET 10.3.1.0 Provider";
                cm.AcquireConnection("ChronicleProduction", true);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show($"Connection Error: {ex.Message}{Environment.NewLine}{Environment.NewLine}" +
                    "Check security group and/or firewall.");
                log.Error($"Error: {ex}", ex);
            }
        }
ConnectionString: 
http://FB.NET?User=CHRON;Password=12345678';Database=C:\Chronicle\Data\CHRON.CTI;DataSource=127.0.0.1;Port=3050;Dialect=1;Charset=NONE;Role=CHRONICLEALLACCESS;Connection)

I am sure I have forgotten something. Please advise.

Thank you,

Todd

Hi,

{$IFDEF NETCORE OR NETSTANDARD}
      // There is no global DbProvider registry in .NET Core
      // So we'll always try to load assembly from the local folder
      if String.IsNullOrEmpty(self.AssemblyName) then begin
        raise new DAConfigurationException(self.Name + ": Database driver assembly not configured");
      end;

I can recommend to copy DataAbstract.daConfig and .NET Core version of FirebirdSql.Data.FirebirdClient.dll near to your server executable.

after this you should update FB.NET section in DataAbstract.daConfig.

by default, it uses FirebirdSql.Data.FirebirdClient, Version=3.0.2.0.

Hi,
Here is my DataAbstract.daConfig file:

<Configuration>

	<KnownDrivers>

		<ODBC.NET>
			<ProviderName>System.Data.Odbc</ProviderName>
			<Description Value="ODBC Data Provider" />
			<ParameterHandling Type="Sequential"
							   SQLSymbol="?" />
			<ProfileMappings Match="Driver">
				<Mapping Name="{Microsoft Access Driver (*.mdb)}"
						 Profile="Access">
					<ParamMappings Database="dbq"
								   Server=""
								   UserID="uid"
								   Password="pwd"/>
				</Mapping>
				<Mapping Name="{SQL Server}"
						 Profile="MSSQL">
					<ParamMappings UserID="uid"
								   Password="pwd" />
				</Mapping>
				<Mapping Name="{Microsoft ODBC for Oracle}"
						 Profile="Oracle" >
					<ParamMappings Database="Data Source"
								   Server=""
								   UserID="uid"
								   Password="pwd"/>
				</Mapping>
				<Mapping Name="{MySQL ODBC 3.51 Driver}"
						 Profile="MySQL">
					<ParamMappings UserID="uid"
								   Password="pwd" />
				</Mapping>
				<Mapping Name="{Sybase System 10}"
						 Profile="Sybase">
					<ParamMappings UserID="uid"
								   Password="pwd" />
				</Mapping>
				<Mapping Name="{Gemini InterBase ODBC Driver 2.0}"
						 Profile="Interbase">
					<ParamMappings UserID="uid"
								   Password="pwd" />
				</Mapping>
				<Mapping Name="{Firebird/InterBase(r) driver}"
						 Profile="Interbase">
					<ParamMappings UserID="uid"
								   Password="pwd" />
				</Mapping>
			</ProfileMappings>
		</ODBC.NET>

		<FB.NET>
			<AssemblyName Value="FirebirdSql.Data.FirebirdClient, Version=7.1.1.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c" />
			<FactoryClassName Value="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory" />
			<Description Value="Firebird Data Provider" />
			<Profile Value="Interbase" />
			<ParameterHandling Type="ByName"
							   SQLSymbol="@"
							   NameSymbol="@" />
			<OptionalParameters>
				<Parameter Name="Role"
						   Value="" />
				<Parameter Name="Dialect"
						   Value="1,2,3" />
				<Parameter Name="Charset"
						   Value="ASCII,BIG_5,CYRL,DOS437,DOS850,DOS852,DOS857,DOS860,DOS861,DOS863,DOS865,EUCJ_0208,GB_2312,ISO8859_1,ISO8859_2,KSC_5601,NEXT,NONE,OCTETS,SJIS_0208,UNICODE_FSS,UTF8,UTF16,UTF32,WIN1250,WIN1251,WIN1252,WIN1253,WIN1254" />
			</OptionalParameters>
			<NewConnectionHelpText>
				<p class="h1">FB.NET Driver</p>
				<p>  This Driver allows you to connect to Interbase via the Firebird .NET driver.</p>
				<p class="h2">Step 2: Server Name</p>
				<p>  In this field, provide the host name or the IP address of the server to which you are connecting.</p>
				<p class="h2">Step 3: Login</p>
				<p>  Use these two fields to provide a username and password to access the database server.</p>
				<p class="h2">Step 4: Database</p>
				<p>  Specify the full path of the database to which you wish to connect (e.g. "c:\..\employee.gdb").</p>
				<p class="h2">Step 5: Custom parameters</p>
				<p>  You can specify additional FB .Net driver specific options as a semicolon separated list of name/value pairs.</p>
			</NewConnectionHelpText>
			<DriverNotFoundText>
				To use the FB.NET driver for Firebird, you must install the open-source firebird driver from http://www.dotnetfirebird.org.
			</DriverNotFoundText>
		</FB.NET>

	</KnownDrivers>

	<IgnoredDrivers>
		<BDP.NET>
			<AssemblyName Value="Borland.Data.Provider, Version=2.5.0.0, Culture=neutral, PublicKeyToken=91d62ebb5b0d1b1b" />
			<ConnectionClassName Value="Borland.Data.Provider.BdpConnection" />
			<DataAdapterClassName Value="Borland.Data.Provider.BdpDataAdapter" />
			<CommandBuilderClassName Value="Borland.Data.Provider.BdpCommandBuilderr" />
			<ConnectionStringBuilderClassName Value="FirebirdSql.Data.Firebird.FbConnectionStringBuilder" />
			<Description Value="Borland Data Provider" />
			<ProfileMappings Match="Assembly">
				<Mapping Name="Borland.Data.Mssql"
						 Value="Borland.Data.Mssql,Version=2.5.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b"
						 Profile="MSSQL" />
				<Mapping Name="Borland.Data.Mysql"
						 Value="Borland.Data.Mysql,Version=2.5.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b"
						 Profile="MySQL" />
				<Mapping Name="Borland.Data.Db2"
						 Value="Borland.Data.Db2,Version=2.5.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b"
						 Profile="DB2" />
				<Mapping Name="Borland.Data.Msacc"
						 Value="Borland.Data.Msacc,Version=2.5.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b"
						 Profile="Access" />
				<Mapping Name="Borland.Data.Oracle"
						 Value="Borland.Data.Oracle,Version=2.5.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b"
						 Profile="Oracle" />
				<Mapping Name="Borland.Data.Sybase"
						 Value="Borland.Data.Sybase,Version=2.5.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b"
						 Profile="Sybase" />
				<Mapping Name="Borland.Data.Interbase"
						 Value="Borland.Data.Interbase,Version=2.5.0.0,Culture=neutral,PublicKeyToken=91d62ebb5b0d1b1b"
						 Profile="Interbase" />
			</ProfileMappings>
			<ParameterHandling Type="ByName"
							   SQLSymbol="@"
							   NameSymbol="@" />
			<OptionalParameters>
			</OptionalParameters>
			<NewConnectionHelpText>
				<p class="h1">Borland Data Provider Driver</p>
			</NewConnectionHelpText>
		</BDP.NET>

	</IgnoredDrivers>

	<DatabaseProfiles>
		<Firebird QuotingIdentifiers='  '>
			<GetTableNames SQL="SELECT TRIM(BOTH ' ' FROM RDB$RELATION_NAME) AS Name FROM RDB$RELATIONS WHERE RDB$VIEW_BLR IS NULL AND RDB$SYSTEM_FLAG = 0 "/>
			<GetForeignKeys SQL=
                      "SELECT PK.RDB$RELATION_NAME ||';'|| 
                MIND.RDB$FIELD_NAME  ||';'||
                FK.RDB$RELATION_NAME ||';'|| 
                DIND.RDB$FIELD_NAME  ||';'||
               FK.RDB$CONSTRAINT_NAME
         FROM RDB$RELATION_CONSTRAINTS FK
         JOIN RDB$REF_CONSTRAINTS FKC ON (FK.RDB$CONSTRAINT_NAME = FKC.RDB$CONSTRAINT_NAME)
         JOIN RDB$RELATION_CONSTRAINTS PK ON (FKC.RDB$CONST_NAME_UQ=PK.RDB$CONSTRAINT_NAME)
         JOIN RDB$INDEX_SEGMENTS MIND ON (PK.RDB$INDEX_NAME=MIND.RDB$INDEX_NAME)
         JOIN RDB$INDEX_SEGMENTS DIND ON (FK.RDB$INDEX_NAME=DIND.RDB$INDEX_NAME)
           AND (MIND.RDB$FIELD_POSITION = DIND.RDB$FIELD_POSITION)
         WHERE (FK.RDB$CONSTRAINT_TYPE = 'FOREIGN KEY')
         ORDER BY FK.RDB$CONSTRAINT_NAME, FK.RDB$RELATION_NAME, MIND.RDB$FIELD_POSITION, DIND.RDB$FIELD_POSITION"/>
			<GetStoredProcedureNames SQL="SELECT TRIM(BOTH ' ' FROM RDB$PROCEDURE_NAME) AS Name FROM RDB$PROCEDURES"/>
			<GetViewNames SQL="SELECT TRIM(BOTH ' ' FROM RDB$RELATION_NAME) AS Name FROM RDB$RELATIONS WHERE RDB$VIEW_BLR IS NOT NULL AND RDB$SYSTEM_FLAG = 0 "/>
			<GetGeneratorNames SQL="SELECT TRIM(BOTH ' ' FROM RDB$GENERATOR_NAME) AS Name FROM RDB$GENERATORS WHERE RDB$SYSTEM_FLAG = 0 ORDER BY RDB$GENERATOR_NAME" />
			<GetLastAutoInc SQL="SELECT Gen_id({0},1) as LastAutoInc FROM RDB$Database"
							SupportsAutoIncs="False"/>
			<DatabaseLocation Type="File"
							  FileMask="Firebird Database (*.gdb, *.fdb)|*.gdb;*.fdb" />
			<ExecuteStoredProcedure WithParams="SELECT * FROM {0}({1})"
									WithoutParams="SELECT * FROM {0}" />
		</Firebird>
		<Interbase QuotingIdentifiers='  '>
			<GetTableNames SQL="SELECT TRIM(TRAILING ' ' FROM RDB$RELATION_NAME) AS Name FROM RDB$RELATIONS WHERE RDB$VIEW_BLR IS NULL AND RDB$SYSTEM_FLAG = 0 "/>
			<GetForeignKeys SQL=
        "SELECT PK.RDB$RELATION_NAME ||';'|| 
                MIND.RDB$FIELD_NAME  ||';'||
                FK.RDB$RELATION_NAME ||';'|| 
                DIND.RDB$FIELD_NAME  ||';'||
               FK.RDB$CONSTRAINT_NAME
         FROM RDB$RELATION_CONSTRAINTS FK
         JOIN RDB$REF_CONSTRAINTS FKC ON (FK.RDB$CONSTRAINT_NAME = FKC.RDB$CONSTRAINT_NAME)
         JOIN RDB$RELATION_CONSTRAINTS PK ON (FKC.RDB$CONST_NAME_UQ=PK.RDB$CONSTRAINT_NAME)
         JOIN RDB$INDEX_SEGMENTS MIND ON (PK.RDB$INDEX_NAME=MIND.RDB$INDEX_NAME)
         JOIN RDB$INDEX_SEGMENTS DIND ON (FK.RDB$INDEX_NAME=DIND.RDB$INDEX_NAME)
           AND (MIND.RDB$FIELD_POSITION = DIND.RDB$FIELD_POSITION)
         WHERE (FK.RDB$CONSTRAINT_TYPE = 'FOREIGN KEY')
         ORDER BY FK.RDB$CONSTRAINT_NAME, FK.RDB$RELATION_NAME, MIND.RDB$FIELD_POSITION, DIND.RDB$FIELD_POSITION"/>
			<GetStoredProcedureNames SQL="SELECT RDB$PROCEDURE_NAME AS Name FROM RDB$PROCEDURES"/>
			<GetViewNames SQL="SELECT RDB$RELATION_NAME FROM RDB$RELATIONS WHERE RDB$VIEW_BLR IS NOT NULL AND RDB$SYSTEM_FLAG = 0 "/>
			<GetGeneratorNames SQL="SELECT RDB$GENERATOR_NAME FROM RDB$GENERATORS WHERE RDB$SYSTEM_FLAG = 0 ORDER BY RDB$GENERATOR_NAME" />
			<GetLastAutoInc SQL="SELECT Gen_id({0},1) as LastAutoInc FROM RDB$Database"
							SupportsAutoIncs="False"/>
			<DatabaseLocation Type="File"
							  FileMask="Interbase files (*.gdb, *.fdb, *.cti)|*.gdb;*.fdb;*.cti" />
			<ExecuteStoredProcedure WithParams="SELECT * FROM {0}({1})"
									WithoutParams="SELECT * FROM {0}" />
		</Interbase>

	</DatabaseProfiles>
</Configuration>

My FirebirdSql.Data.FirebirdClient.dll is next to the exe as you suggested.

Still getting the same error. Is there any chance you could provide me with a sample of how to connect firebird to the DataAbstract world with .NETCore dlls?

Hi,

I’ve attached sample: 29880.zip (18.2 KB)

You should just include reference to FirebirdSql.Data.FirebirdClient.dll into project.

In my testcase, I’ve added reference to FirebirdSql.Data.FirebirdClient nuget package.

note: editing and adding DataAbstract.daConfig into output folder isn’t required for .NET Core.