Help!
I have been trying for the past week and a half to connect to a Firebird
(2.5.1) database from a Visual Studio 2008 C# WinForms Application.
The code I am running is:
private void GetData(string sql)
{
Cursor = Cursors.WaitCursor;
//create the connection/table adapter
FbConnection con = new FbConnection(conString());
FbDataAdapter da = new FbDataAdapter(sql, con);
//create and fill the dataset
da.Fill(wdDataSet,"JOBQUOTEHEADER");
^ Code breaks here with "an Index was outside the bounds
of the array." exception.
dgvResults.DataSource = dDataSet.Tables["JOBQUOTEHEADER"];
this.Text = wdDataSet.Tables[0].Rows.Count + " Records found";
Cursor = Cursors.Default;
}
private string conString()
{
//build me a connection string
FbConnectionStringBuilder csb = new FbConnectionStringBuilder();
csb.UserID = "SYSDBA";
csb.Password = "masterkey";
csb.DataSource = "localhost";
csb.Database = "C:\\Firebird\\Data\\WDESIGN.FDB";
csb.Port = 3050;
return csb.ConnectionString;
}
The FirebirdSql.Data.FirebirdClient.dll resides in the C:\Program
Files\Firebird\FirebirdDDEX directory.
I have run the .Reg files and edited the Machine.Config as follows:
<configSections>
<section name="firebirdsql.data.firebirdclient"
type="System.Data.Common.DbProviderConfigurationHandler, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<DbProviderFactories>
<add name="FirebirdClient Data Provider"
invariant="FirebirdSql.Data.FirebirdClient" description=".Net Framework Data
Provider for Firebird"
type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory,
FirebirdSql.Data.FirebirdClient, Version=2.5.1.0, Culture=neutral,
PublicKeyToken=3750abcc3150b00c" />
My colleague is running the same code and all works fine with him.
Obviously I have something different in my setup from him, but I cannot see
what it is!
I am now desperate for fresh ideas, any offers?
Paul Bennett
Bove's Theorem
The remaining work to finish in order to reach your goal increases as the
deadline approaches.
Tracking #: 5CEC4D846C94F14CA2B882DE694C686AF80137E6
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider