ThatRickGuy
Programmer
Hey Guys,
I'm having a heck of a time trying to get some dynamic code working. I am pulling the structure of an Oracle table out of the database and generating text based on it. The only problem is, when I pull back an empty table an look at the columns' data type, Integer columns are showing up as Decimal.
So a table like this:
When I do this:
Even though the fields are defined as an Integer in the database, .Net is defining the columns Decimal. While this isn't a huge functional problem, it is killing my documentation.
Anyone know of a way to either get that code to return the correct Oracle datatype, or to get the DESC command to work, even if it just returns a big string?
-Rick
VB.Net Forum forum796 forum855 ASP.NET Forum
I believe in killer coding ninja monkeys.![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
I'm having a heck of a time trying to get some dynamic code working. I am pulling the structure of an Oracle table out of the database and generating text based on it. The only problem is, when I pull back an empty table an look at the columns' data type, Integer columns are showing up as Decimal.
So a table like this:
Code:
CREATE TABLE SLIDE
(
SLIDE_ID INTEGER,
PRESENTATION_ID INTEGER,
AUDIO_ID INTEGER,
SEQUENCE INTEGER
)
When I do this:
Code:
Dim oleConn As New Data.OleDb.OleDbConnection("Provider=msdaora;Data Source=" & Cred.Environment & ";User Id=" & Cred.UserName & ";Password=" & Cred.Password & ";")
Dim oleCmd As New Data.OleDb.OleDbCommand("SELECT * FROM " & Me.cmbNamespace.Text & "." & Me.cmbTable.Text & " WHERE 1=0", oleConn)
oleConn.Open()
Dim dt As New DataTable
Dim da As New OleDb.OleDbDataAdapter(oleCmd)
da.Fill(dt)
Debug.WriteLine(dt.Columns(0).DataType.ToString)
Even though the fields are defined as an Integer in the database, .Net is defining the columns Decimal. While this isn't a huge functional problem, it is killing my documentation.
Anyone know of a way to either get that code to return the correct Oracle datatype, or to get the DESC command to work, even if it just returns a big string?
-Rick
VB.Net Forum forum796 forum855 ASP.NET Forum
![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)