Hi,

I'm trying to read a single-byte in FB2.0 database as char(1) field with 
charset/NONE. I am using the byte as binary information ranging 0-255, not 
as a letter in text. With FbDataAdapter's Fill method, the data is 
translated into a string in a DataTable. It seems that when the value of the 
single-byte data exceeds 127, the byte turns into two-byte unicode char with 
a default encoding. I do not want the original single byte to be translated 
into unicode char. So I did something like:

DataTable dt = new DataTable();
dt.Columns.Add("dtd", typeof (byte));  // "dtd" is the name of the database 
field
....
using(DbDataAdapter da = MyFbDataAdapterFactoryMethod(...))
{
  da.Fill(dt);
}

then I got an error at Fill() method saying: incorrect input data format, it 
should be 'Byte' type (translated into English).

What is a simple way to accomplish this kind of task? I'm new to .NET /.NET 
data provider environment. It is a no-brainer with Win32/C++/IBX, but I 
cannot figure it out with .NET.

Thanks,
Nobuya 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to