' Return a property of a field ' expC1 Field Public Function GetColumnProperty(ByVal tcField As String) As String Dim lcFieldName As String = "" Dim llSuccess As Boolean = False Dim lnColumnSize As Integer = 0 Dim loObject As Object = "" Dim loRow As DataRow ' Trim just in case tcField = Trim(tcField) ' Locate the field For Each loRow In oDataTable.Rows lcFieldName = loRow("ColumnName") ' If this is the field If UCase(lcFieldName) = UCase(tcField) Then loObject = loRow(tcProperty) ' Just in case we need it down below lnColumnSize = loRow("ColumnSize") llSuccess = True Exit For End If Next ' If the property is DataType If UCase(tcProperty) = "DATATYPE" Then lcType = loObject.ToString End If Return lcType End FunctionWhen I pass a field which is a Type, when this field is coming from SQL Anywhere, the data type is known as String. So, of course, when I use that type in a query for a parameter definition, it would cause an erro.
loConnection = New OdbcConnection(oConnectionOpenManually.cConnectionString) loConnection.Open() oCommand = New OdbcCommand oCommand.Connection = loConnection oCommand.CommandText = "Select * From " + tcTable oDataReader = oCommand.ExecuteReader(CommandBehavior.SchemaOnly) oDataTable = oDataReader.GetSchemaTable oDataReader.Close()Anyone would know if it is normal that a datatype Time would be known as a String? Because, I have no way presently to tell the framework to define the data type properly to a Time in order to have my parameterized query to be properly defined.