Accessing ORACLE with SQL SERVER generated Business Object (Problem)


Author
Message
Ertan Deniz
Ertan Deniz
StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)
Group: Forum Members
Posts: 163, Visits: 493
Business Object was filled from ORACLE. (Table)

But When I 'm trying to access "id" property getting the error "specified cast is not valid".

Id property (Int32), Datatable.Column.type is System.Decimal. (ORacle table column is NUMBER").

I've run the query through FillDataTable("Select statement") command.

public System.Int32 id

{

get

{

return (System.Int32)this.CurrentRow["id"];

}

set

{

this.CurrentRow["id"] = value;

}

}

Replies
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I'd suggest using the custom code area in the BO mapper. Then it won't get overwritten.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
OK, so the business object was built against a SQL Server table through the business object mapper, but you're using ORACLE to populate the business object at runtime? 

If so, then there's you're problem.  When you build the business object against a database at design-time, then it's highly recommended that you execute the business object against the same database type at runtime.  So, if you use the BOMapper to build the schema against the ORACLE table, then all of those Int columns will be changed to System.Decimal instead.  Then, your code that accesses the business object can worry about the type conversions.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ertan Deniz - 17 Years Ago
Dustin Taylor - 17 Years Ago
Ertan Deniz - 17 Years Ago
Greg McGuffey - 17 Years Ago
StrataFrame Team - 17 Years Ago
Ertan Deniz - 17 Years Ago
Ertan Deniz - 17 Years Ago
Ertan Deniz - 17 Years Ago
Dustin Taylor - 17 Years Ago
Ertan Deniz - 17 Years Ago
David Daragon - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Ertan Deniz - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Ertan Deniz - 17 Years Ago
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search