Subject | Re: c# connection string datasource |
---|---|
Author | rkamarowski |
Post date | 2007-07-19T11:50:11Z |
i spent last night doing the following updates:
* moved the database to the same folder as the software.
* installed embedded firebird.
* moved the appropriate firebird embedded files to the same directory
as the application executable.
* updated the system dsn entry to the new location and successfully
tested the connection.
versions:
=========
Firebird - AD0.NET 2.0 provider 2.0.0.0
Firebird embedded 1.5.3
Microsoft Visual C# codename Orcas Version 9.0 Beta 1
Microsoft .NET Framework 2.0
the new code:
=============
string connStr;
connStr = "User=SYSDBA;" +
"Password=masterkey;" +
"Database=C:/Photography/Software/rak-photography/rak-photography/rak-photography.fdb;"
+
"ServerType=1";
FbConnection conn = new FbConnection(connStr);
conn.Open();
the new error:
==============
System.DllNotFoundException was unhandled
Message="Unable to load DLL 'fbembed': The specified module could
not be found. (Exception from HRESULT: 0x8007007E)"
Source="FirebirdSql.Data.FirebirdClient"
TypeName=""
StackTrace:
at
FirebirdSql.Data.Client.Embedded.FbClient.isc_attach_database(Int32[]
statusVector, Int16 dbNameLength, Byte[] dbName, Int32& dbHandle,
Int16 parmBufferLength, Byte[] parmBuffer)
at
FirebirdSql.Data.Client.Embedded.FesDatabase.Attach(DatabaseParameterBuffer
dpb, String dataSource, Int32 port, String database)
at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
at FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create()
at FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut()
at FirebirdSql.Data.FirebirdClient.FbConnection.Open()
at rak_photography.FormMain..ctor() in
C:\Photography\Software\rak-photography\rak-photography\FormMain.cs:line
42
at rak_photography.Program.Main() in
C:\Photography\Software\rak-photography\rak-photography\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(Assembly assembly,
String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
* moved the database to the same folder as the software.
* installed embedded firebird.
* moved the appropriate firebird embedded files to the same directory
as the application executable.
* updated the system dsn entry to the new location and successfully
tested the connection.
versions:
=========
Firebird - AD0.NET 2.0 provider 2.0.0.0
Firebird embedded 1.5.3
Microsoft Visual C# codename Orcas Version 9.0 Beta 1
Microsoft .NET Framework 2.0
the new code:
=============
string connStr;
connStr = "User=SYSDBA;" +
"Password=masterkey;" +
"Database=C:/Photography/Software/rak-photography/rak-photography/rak-photography.fdb;"
+
"ServerType=1";
FbConnection conn = new FbConnection(connStr);
conn.Open();
the new error:
==============
System.DllNotFoundException was unhandled
Message="Unable to load DLL 'fbembed': The specified module could
not be found. (Exception from HRESULT: 0x8007007E)"
Source="FirebirdSql.Data.FirebirdClient"
TypeName=""
StackTrace:
at
FirebirdSql.Data.Client.Embedded.FbClient.isc_attach_database(Int32[]
statusVector, Int16 dbNameLength, Byte[] dbName, Int32& dbHandle,
Int16 parmBufferLength, Byte[] parmBuffer)
at
FirebirdSql.Data.Client.Embedded.FesDatabase.Attach(DatabaseParameterBuffer
dpb, String dataSource, Int32 port, String database)
at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
at FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create()
at FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut()
at FirebirdSql.Data.FirebirdClient.FbConnection.Open()
at rak_photography.FormMain..ctor() in
C:\Photography\Software\rak-photography\rak-photography\FormMain.cs:line
42
at rak_photography.Program.Main() in
C:\Photography\Software\rak-photography\rak-photography\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(Assembly assembly,
String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
--- In firebird-support@yahoogroups.com, "jft" <jft@...> wrote:
>
> In the following line:
> > Database=c:/photography/databaase/c#/rak-photography;
> did you intend to spell the word "database" as "databaase"?
> Cheers,
> John
> > -------Original Message-------
> > From: rkamarowski <rkamarowski@...>
> > Subject: [firebird-support] c# connection string datasource
> > Sent: 18 Jul '07 23:24
> >
> > the following connection string is returning an error:
> >
> > connStr = "User=SYSDBA;
> > Password=masterkey;
> > Database=c:/photography/databaase/c#/rak-photography;
> > DataSource=rak;
> > SystemType=1;";
> >
> > i have a System DSN defined as 'rak' with the Firebird/InterBase(r)
> > Driver
> >
> > below is the error. what am i doing wrong???
> > thanks,
> > bob k.
> > -----------
> > FirebirdSql.Data.FirebirdClient.FbException was unhandled
> > Message="Unable to complete network request to host \"rak\"."
> > Source="FirebirdSql.Data.FirebirdClient"
> > ErrorCode=-2147467259
> > StackTrace:
> > at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
> > at FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create()
> > at FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut()
> > at FirebirdSql.Data.FirebirdClient.FbConnection.Open()
> > at rak_photography.FormMain..ctor() in
> >
> >
C:\Photography\Software\rak-photography\rak-photography\rak-photography\FormMain.cs:line
> > 40
> > at rak_photography.Program.Main() in
> >
> >
C:\Photography\Software\rak-photography\rak-photography\rak-photography\Program.cs:line
> > 17
> > at System.AppDomain._nExecuteAssembly(Assembly assembly,
> > String[] args)
> > at System.AppDomain.ExecuteAssembly(String assemblyFile,
> > Evidence assemblySecurity, String[] args)
> > at
> > Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
> > at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
> > at System.Threading.ExecutionContext.Run(ExecutionContext
> > executionContext, ContextCallback callback, Object state)
> > at System.Threading.ThreadHelper.ThreadStart()
> > InnerException: FirebirdSql.Data.Common.IscException
> > Message="Exception of type
> > 'FirebirdSql.Data.Common.IscException' was thrown."
> > Source="FirebirdSql.Data.FirebirdClient"
> > ErrorCode=335544721
> > IsWarning=false
> > StackTrace:
> > at
> > FirebirdSql.Data.Client.Gds.GdsConnection.Connect(String dataSource,
> > Int32 port, Int32 packetSize, Charset charset)
> > at
> >
FirebirdSql.Data.Client.Gds.GdsDatabase.Attach(DatabaseParameterBuffer
> > dpb, String dataSource, Int32 port, String database)
> > at
> > FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
> > InnerException:
> >
> >
>