From: Christian W. <chr...@rt...> - 2006-08-28 16:15:15
|
Hello=20 I am trying to fill a Crystal report from a Firebird database via = ADO.NET, but the report contains no data rows. I have workt through the tutorial from Microsoft and can fill Crystal = reports with CUSTOMER from ACCESS database and OLE DB. The following code is from the tutorial: class DataSetConfiguration { private const string CONNECTION_STRING =3D = "Provider=3DMicrosoft.Jet.OLEDB.4.0;Data = Source=3DC:\\Programme\\Microsoft Visual Studio 8\\Crystal = Reports\\Samples\\en\\Databases\\xtreme.mdb"; private const string QUERY_STRING =3D "SELECT * FROM CUSTOMER"; private const string DATATABLE_NAME =3D "Customer"; public static DataSet CustomerDataSet { get { CustomerDataSetSchema dataSet =3D new CustomerDataSetSchema(); OleDbConnection oleDbConnection =3D new OleDbConnection( = CONNECTION_STRING ); OleDbDataAdapter oleDbDataAdapter =3D new OleDbDataAdapter( = QUERY_STRING, oleDbConnection ); oleDbDataAdapter.Fill( dataSet, DATATABLE_NAME ); return dataSet; } } } I try the same with a Firebird ADO.net connection and the adapted code: public static DataSet LogosDataSet { get { ServiceStationLibLogos dataSet =3D new ServiceStationLibLogos(); FbConnectionStringBuilder conStrBuilder =3D new = FbConnectionStringBuilder(); FbConnection connection =3D new FbConnection( "data = source=3Dlocalhost;initial = catalog=3DE:\\ServiceStation\\SERVICESTATIONLIB.FDB;user = id=3Dsysdba;password=3Dmasterkey"); connection.Open(); FbDataAdapter dataAdapter =3D new FbDataAdapter( "select * from = \"Logos\"", connection ); dataAdapter.Fill( dataSet ); connection.Close(); return dataSet; } } but my report returns no data. What am I missing ? Who has a working = example to fill Crystal report from firebird with ADO.NET? |
From:
<car...@mu...> - 2006-08-28 17:12:00
|
Hello: > > dataAdapter.Fill( dataSet ); > Try: dataAdapter.Fill( dataSet, DATATABLE_NAME ); -- Carlos Guzmán Álvarez Vigo-Spain |
From: Christian W. <chr...@rt...> - 2006-08-30 19:37:05
|
Hello I now can load a Crystal Report from firebird with ADO.NET. I use a case sensitive database (quoted identifiers, not every body = likes this, but the VS 2005 generated code looks much nicer), and I have = to use quotes sometimes and sometimes not: The contructor of FbDataAdapter must have quoted identifiers, the Fill = methode must NOT have quoted identifiers. Has some one an explanation = for this? public static DataSet LogosDataSet { get { ServiceStationLibLogos dataSet =3D new ServiceStationLibLogos(); FbConnection connection =3D new FbConnection( "data = source=3Dlocalhost;initial = catalog=3DE:\\ServiceStation\\SERVICESTATIONLIB.FDB;user = id=3Dsysdba;password=3Dmasterkey"); FbDataAdapter dataAdapter =3D new FbDataAdapter( "select * from = \"Logos\"", connection ); // Expected, but NOT working:=20 // dataAdapter.Fill( dataSet, "\"Logos\"" ); // Unexpected, but working: dataAdapter.Fill( dataSet, "Logos" ); return dataSet; } } CREATE TABLE "Logos" ( "UniqueId" BIGINT DEFAULT 0 NOT NULL, "Name" VARCHAR(80), "Image" BLOB SUB_TYPE 2 SEGMENT SIZE 4096 ); Thanks Chris ----- Original Message -----=20 From: "Carlos Guzm=E1n =C1lvarez" <car...@mu...> To: "For users and developers of the Firebird .NET providers" = <fir...@li...> Sent: Monday, August 28, 2006 7:11 PM Subject: Re: [Firebird-net-provider] Crystal Report with ADO.Net 2.0, = how to get data in the report? Hello: > > dataAdapter.Fill( dataSet ); > Try: dataAdapter.Fill( dataSet, DATATABLE_NAME ); --=20 Carlos Guzm=E1n =C1lvarez Vigo-Spain -------------------------------------------------------------------------= Using Tomcat but need to do more? Need to support web services, = security? Get stuff done quickly with pre-integrated technology to make your job = easier Download IBM WebSphere Application Server v.1.0.1 based on Apache = Geronimo http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 _______________________________________________ Firebird-net-provider mailing list Fir...@li... https://lists.sourceforge.net/lists/listinfo/firebird-net-provider __________ NOD32 1.1729 (20060828) Information __________ Diese E-Mail wurde vom NOD32 antivirus system gepr=FCft http://www.nod32.com |
From:
<car...@mu...> - 2006-08-30 19:53:43
|
Hello: > Has some one an explanation for this? Yes, the name you give in the Fill call is the name of the table that will be created in the DataSet and filled with the data from the Firebird table. -- Carlos Guzmán Álvarez Vigo-Spain |