>There is SqlDbType.VarChar data type, but System.String type. So, for all char data it will be System.String type.
Well, this causes a problem, as when I use a database which is not bound to my data dictionary, I need to rely on what the DataTable will return. So, I need to be able to differentiate between a string and a varchar.
For example, this is a method I have that I call when I need to know the data type of a column, if I do not have my data dictionary to rely on. This assumes oDataTable is already available. So, I pass the field, in this case a column formely known in SQL Server, and the property I need to get info from. So, the one that is of interest here is DataType. So, I can call the method here with "FirstName", "DataType" and this will return System.String, for example, if FirstName is a column of type Character in SQL Server. But, I need a way to differentiate that from a VarChar. This seems impossible I would assume.
Public Function GetColumnProperty(ByVal tcField As String, ByVal tcProperty As String) As Object
Dim lcFieldName As String = ""
Dim loRow As DataRow = Nothing
tcField = Trim(tcField)
For Each loRow In oDataTable.Rows
lcFieldName = loRow("ColumnName")
If UCase(lcFieldName) = UCase(tcField) Then
lcType = loRow("DataType")
End If
Next