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;

}

}

Reply
Dustin Taylor
Dustin Taylor
StrataFrame Team Member (938 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
All numbers in Oracle are stored as floating point numbers, so they come out as decimal. To ensure that you can return it as an integer, use the System.Convert.ToInt32() method instead of casting it as an integer.
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