byte[] DataColumn

Posts   
 
    
gof
User
Posts: 41
Joined: 28-Aug-2004
# Posted on: 27-Jan-2005 12:05:25   

Hi

I have some problems with BLOB datatype when using Typedlist. Typedlist is getting only one simple table with few attributes and one blob attribute 'IKONA'. The generated data type for this column is Byte[].

When filling there is exception poping: "Inconvertable type mismatch between SourceColumn 'IKONA' of Array and the DataColumn 'Ikona' of Byte[]."

Thanks for any help

Ivo

p.s. database is firebird

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 27-Jan-2005 18:48:17   

Hmm. A typed list is filled with the Firebird.NET provider's dataadapter object, so this should work OK. Could you post a stacktrace of the error and also the sql creation script for the table? (as blobs can be defined in various ways on firebird)

Frans Bouma | Lead developer LLBLGen Pro
gof
User
Posts: 41
Joined: 28-Aug-2004
# Posted on: 27-Jan-2005 18:54:22   

Otis wrote:

Hmm. A typed list is filled with the Firebird.NET provider's dataadapter object, so this should work OK. Could you post a stacktrace of the error and also the sql creation script for the table? (as blobs can be defined in various ways on firebird)

--- begin stack trace --- Exception Information Netgen.Advocata.AppException: Greska u glavnoj formi ---> System.InvalidOperationException: Inconvertable type mismatch between SourceColumn 'IKONA' of Array and the DataColumn 'Ikona' of Byte[]. at System.Data.Common.DataColumnMapping.GetDataColumnBySchemaAction(DataTable dataTable, Type dataType, MissingSchemaAction schemaAction) at System.Data.Common.SchemaMapping.SetupSchemaWithoutKeyInfo(MissingMappingAction mappingAction, MissingSchemaAction schemaAction, Boolean gettingData, DataColumn parentChapterColumn, Object chapterValue) at System.Data.Common.SchemaMapping.SetupSchema(SchemaType schemaType, String sourceTableName, Boolean gettingData, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.FillSchemaMapping(Object data, String srcTable, IDataReader dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.FillSchemaMappingTry(Object data, String srcTable, IDataReader dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDataReader dataReader) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteMultiRowDataTableRetrievalQuery(IRetrievalQuery queryToExecute, DbDataAdapter dataAdapterToUse, DataTable tableToFill) at Netgen.Advocata.LLBL.DaoClasses.TypedListDAO.GetMultiAsDataTable(IEntityFields fieldsToReturn, DataTable tableToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, Boolean allowDuplicates, IGroupByCollection groupByClause, ITransaction transactionToUse, Int32 pageNumber, Int32 pageSize) in C:\Documents and Settings\Ivo Lukac\My Documents\Visual Studio Projects\Advocata\LLBL.firebird\DaoClasses\TypedListDAO.cs:line 77 at Netgen.Advocata.LLBL.TypedListClasses.VrsteOznakaTypedList.Fill(Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, Boolean allowDuplicates, IPredicate selectFilter, ITransaction transactionToUse, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize) in C:\Documents and Settings\Ivo Lukac\My Documents\Visual Studio Projects\Advocata\LLBL.firebird\TypedListClasses\VrsteOznakaTypedList.cs:line 213 at Netgen.Advocata.LLBL.TypedListClasses.VrsteOznakaTypedList.Fill() in C:\Documents and Settings\Ivo Lukac\My Documents\Visual Studio Projects\Advocata\LLBL.firebird\TypedListClasses\VrsteOznakaTypedList.cs:line 111 at Netgen.Advocata.GUI.frmGlavna.menuItem21_Click(Object sender, EventArgs e) in c:\documents and settings\ivo lukac\my documents\visual studio projects\advocata\pravni ured\frmglavna.cs:line 2473 at Netgen.Advocata.GUI.frmGlavna.frmGlavna_Load(Object sender, EventArgs e) in c:\documents and settings\ivo lukac\my documents\visual studio projects\advocata\pravni ured\frmglavna.cs:line 2450 at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow) at System.Windows.Forms.Control.SetVisibleCore(Boolean value) at System.Windows.Forms.Form.SetVisibleCore(Boolean value) at System.Windows.Forms.Control.set_Visible(Boolean value) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() at Netgen.Advocata.GUI.frmPrijavaZaRad.btnPrihvati_Click(Object sender, EventArgs e) in c:\documents and settings\ivo lukac\my documents\visual studio projects\advocata\pravni ured\frmprijavazarad.cs:line 234 --- End of inner exception stack trace ---

--- begin sql ddl --- CREATE TABLE TBLVRSTAOZNAKE ( SIFVRSTAOZNAKE INTEGER NOT NULL, NAZIVVRSTEOZNAKE VARCHAR (127) CHARACTER SET NONE NOT NULL COLLATE NONE, IKONA BLOB sub_type 0 segment size 80); --- end sql ddl ---

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 27-Jan-2005 19:22:49   

Ok, thanks I'll try to reproduce it here. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
gof
User
Posts: 41
Joined: 28-Aug-2004
# Posted on: 28-Jan-2005 11:45:36   

Otis wrote:

Ok, thanks I'll try to reproduce it here. simple_smile

Any success?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 28-Jan-2005 12:02:00   

This indeed goes wrong in Firebird, but succeeds in sqlserver. If I change the type to System.Array for the DataColumn it works. If I fetch a blob (byte[]) from sqlserver in a typed list, which has the same datacolumn setup:

SqlServer: _columnPhoto = new DataColumn("Photo", typeof(System.Byte[]), null, MappingType.Element);

Firebird: _columnBlobster = new DataColumn("Blobster", typeof(System.Byte[]), null, MappingType.Element);

it works OK.

Must be some glitch in the Firebird.NET provider. I'll mail Carlos about this.

Frans Bouma | Lead developer LLBLGen Pro
gof
User
Posts: 41
Joined: 28-Aug-2004
# Posted on: 28-Jan-2005 12:12:07   

Otis wrote:

This indeed goes wrong in Firebird, but succeeds in sqlserver. If I change the type to System.Array for the DataColumn it works. If I fetch a blob (byte[]) from sqlserver in a typed list, which has the same datacolumn setup:

SqlServer: _columnPhoto = new DataColumn("Photo", typeof(System.Byte[]), null, MappingType.Element);

Firebird: _columnBlobster = new DataColumn("Blobster", typeof(System.Byte[]), null, MappingType.Element);

it works OK.

Must be some glitch in the Firebird.NET provider. I'll mail Carlos about this.

Hope he will fix it simple_smile

in the meanwhile I am coding some other stuff and going to drink some beer simple_smile

ivo

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 28-Jan-2005 13:10:06   

gof wrote:

Otis wrote:

This indeed goes wrong in Firebird, but succeeds in sqlserver. If I change the type to System.Array for the DataColumn it works. If I fetch a blob (byte[]) from sqlserver in a typed list, which has the same datacolumn setup:

SqlServer: _columnPhoto = new DataColumn("Photo", typeof(System.Byte[]), null, MappingType.Element);

Firebird: _columnBlobster = new DataColumn("Blobster", typeof(System.Byte[]), null, MappingType.Element);

it works OK.

Must be some glitch in the Firebird.NET provider. I'll mail Carlos about this.

Hope he will fix it simple_smile

in the meanwhile I am coding some other stuff and going to drink some beer simple_smile ivo

heh, beer in the early afternoon... sounds good! wink

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 28-Jan-2005 16:46:57   

It's a bug in 1.6.3 of the Firebird.NET driver. Carlos has fixed it, it should be up in CVS soon. I've asked him to mail me a new build so you'll have a new build soon. You can also grab the source from sourceforge's CVS and build the provider yourself. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 28-Jan-2005 17:01:10   

Mail sent

Frans Bouma | Lead developer LLBLGen Pro
gof
User
Posts: 41
Joined: 28-Aug-2004
# Posted on: 28-Jan-2005 17:02:42   

Otis wrote:

It's a bug in 1.6.3 of the Firebird.NET driver. Carlos has fixed it, it should be up in CVS soon. I've asked him to mail me a new build so you'll have a new build soon. You can also grab the source from sourceforge's CVS and build the provider yourself. simple_smile

no time for buliding it my self rage

thanks for quick problem solving. I had a filing that nobody uses Firebird simple_smile

ivo

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 28-Jan-2005 18:35:55   

Firebird is used, not by many, but you're not alone simple_smile

Frans Bouma | Lead developer LLBLGen Pro