This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I'm currently converting tables from SQL Server to Oracle. Some of the tables have a column with a uniqueidentifier datatype column set as the primary key. When converting the table to Oracle I use the datatype Raw for the primary key column. I'm not able to select data by using the following code: var data = unitOfWork.TableName; --or-- var data = unitOfWork.TableName.Where(x => x.columnName = "someValue"); The IdentityMethod and IdentityType for the primary key column are set to "Guid". Error message: Unable to materialize field [Id] on type [oracletest.Testtable]. Check your table has an Id column and that your mappings are correct Inner exception: "Unable to cast object of type 'System.Byte[]' to type 'System.String'." Has somebody an idea? |
|
|
For GUIDs on non-SQL Server databases, use the string type e.g. CHAR(36) or VARCHAR2(36) instead of Raw. LightSpeed automatically translates between database strings and .NET GUIDs when required. |
|
|
Thank you, I am going to try this. |
|