N
news.microsoft.com
I read somewhere (I don't remember where, and can't find it again) that when
you fill a DataTable via the System.Data.OracleClient.OracleDataAdapter, the
data type of each column in the DataTable is automatically set to a .NET
equivalent of the Oracle data type. It doesn't seem to work for me with the
code below. All of my columns are of type System.String, even when the
Oracle data type is Number. Can anyone tell me how I get the DataTable
columns to assume the (equivalent) data type from the Oracle?
-----------
Imports System.Data.OracleClient
Dim dt As DataTable = New DataTable
Dim SelectStatement as String = "SELECT DISTINCT INITCAP(" & FieldName & ")
" & FieldName & " FROM " & TableName
Dim da As OracleDataAdapter = New OracleDataAdapter(SelectStatement,
DBConnection)
da.Fill(dt)
For i As Int32 = 0 To dt.Columns.Count - 1
MyWriteDebug("DataType: " & dt.Columns(i).DataType.FullName)
Next
you fill a DataTable via the System.Data.OracleClient.OracleDataAdapter, the
data type of each column in the DataTable is automatically set to a .NET
equivalent of the Oracle data type. It doesn't seem to work for me with the
code below. All of my columns are of type System.String, even when the
Oracle data type is Number. Can anyone tell me how I get the DataTable
columns to assume the (equivalent) data type from the Oracle?
-----------
Imports System.Data.OracleClient
Dim dt As DataTable = New DataTable
Dim SelectStatement as String = "SELECT DISTINCT INITCAP(" & FieldName & ")
" & FieldName & " FROM " & TableName
Dim da As OracleDataAdapter = New OracleDataAdapter(SelectStatement,
DBConnection)
da.Fill(dt)
For i As Int32 = 0 To dt.Columns.Count - 1
MyWriteDebug("DataType: " & dt.Columns(i).DataType.FullName)
Next