Odbc convert string to number
Get via App Store Read this post in our app!
How to convert Number Datatype to Text Datatype - ODBC Query - C#
I am developing a Windows Forms Application in C# with 2.0 being the underlying .Net Framework. I use .Net Framework Data Provider for ODBC in order to connect to a specific access database.
I have a field say "NumberColumn" with 'Number' datatype & another field say "StringColumn" with 'Text' datatype in one of the tables present in the database. I have to concatenate the values present in the two fields in this format ("StringColumn-NumberColumn").
I tried using the convert function "CStr" in the query to convert the number column and append with the string column but am getting an exception "Invalid scalar function CStr".
Presently, am doing this concatenation in the DataTable level which I feel is expensive considering the huge amount of data. How could I achieve the concatenation in the specified format while querying the data?
I don't think you mention the database but I would expect something like
may do what you want, but that becomes database dependent.
If you are saying its access, and you are using the jet provider then I would think that
Would work. At least it does directly to the MS Access ODBC driver