Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-23 Thread Jiri Cincura
On 6/23/07, Nobuya Higuchi [EMAIL PROTECTED] wrote: I'm sorry but this is exactly where it started. with the single-byte value being '\xA0' byte.Parse(inputstring) emits an error saying incorrect input format. If you read the documentation of FW: Converts the string representation of a

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-23 Thread Nobuya Higuchi
First convert the char(1) in your charset into unicode (cause everything in FW work with unicode), then use simple conversion: char c = 'a'; byte b = (byte)c; You can do char c = 'a' because 'a' is a Char. You can't do char c = (byte)'\xA0'; // a byte with the value of hexadecimal A0, not

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-23 Thread Jiri Cincura
On 6/23/07, Nobuya Higuchi [EMAIL PROTECTED] wrote: First convert the char(1) in your charset into unicode (cause everything in FW work with unicode), then use simple conversion: char c = 'a'; byte b = (byte)c; You can do char c = 'a' because 'a' is a Char. You can't do char c =

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-23 Thread Jiri Cincura
On 6/23/07, Nobuya Higuchi [EMAIL PROTECTED] wrote: FW means Framework. There are many framework, but here, you seem to mean .NET framework. OK, wer're in net-provider list. I suppose, that's obvious, that I'm talking about .NET FW. I'm sorry, but it is. Every piece of code in FW is

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-23 Thread Nobuya Higuchi
0xA0 ISN'T valid char because EVERYTHING in FW is unicode. You have to convert your value to unicode first fo be able to cast it to byte. Well, so I have been asking how. Let me put it this way. I have a byte in the database (FB2.0). and we have a Byte type in .NET world. I would like to use

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-23 Thread Jiri Cincura
On 6/23/07, Nobuya Higuchi [EMAIL PROTECTED] wrote: Thank you for your help. I'm still wondering why .net provider does not support direct byte read in FbDataAdapter's Fill method, though. It does, cause' it follows abstract ADO.NET classes. If there's a source with byte, you get it with byte.

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-23 Thread Nobuya Higuchi
FW means Framework. There are many framework, but here, you seem to mean .NET framework. I'm sorry, but it is. Every piece of code in FW is written to work primarily with unicode. The way, that you can use any other character set is the feature. As for string or text, yes, but that is not

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-23 Thread Carlos Guzmán Álvarez
Hello: So are you saying I should store this single byte as BLOB in FB2.0 database? Use a smallint field. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-23 Thread Nobuya Higuchi
BTW in FB default UDF pack is ascii_char and ascii_val function. Why not to use it for getting values from DB. Note.: Depends on your needs and performance issues. Finally, you tell me how, and I thank you profundly. ascii_val sounds promising. I have been using my own UDF and didn't look

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-23 Thread Jiri Cincura
On 6/23/07, Nobuya Higuchi [EMAIL PROTECTED] wrote: Well, so I have been asking how. Let me put it this way. I have a byte in Use the Encoding class (namespace System.Text). the database (FB2.0). and we have a Byte type in .NET world. I would like to use the byte information in .NET as a

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-23 Thread Jiri Cincura
BTW in FB default UDF pack is ascii_char and ascii_val function. Why not to use it for getting values from DB. Note.: Depends on your needs and performance issues. -- Jiri {x2} Cincura http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-22 Thread Jiri Cincura
On 6/21/07, Nobuya Higuchi [EMAIL PROTECTED] wrote: What's your connection string charset? -- Jiri {x2} Cincura CharSet=NONE Try to add column as object not as byte. Probably there's some casting. The look what's inside object (it'll be probably char). When you will know this, do

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-22 Thread Kyris
? Nobuya Higuchi [EMAIL PROTECTED] ?? ??? ?? news:[EMAIL PROTECTED] Hi, I'm trying to read a single-byte in FB2.0 database as char(1) field with ... DataTable dt = new DataTable(); dt.Columns.Add(dtd, typeof (byte)); // dtd is the name of the database field

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-22 Thread Nobuya Higuchi
Try this DataTable dt = new DataTable(); dt.Columns.Add(dtd, System.Type.GetType(System.Byte)); // dtd is the name of the database field K. Result: It produces the same error as in case of dt.Columns.Add(dtd, typeof(byte)); System.ArgumentException : (the byte content) not able to

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-22 Thread Nobuya Higuchi
Try to add column as object not as byte. Probably there's some casting. The look what's inside object (it'll be probably char). When you will know this, do casting to byte just before filling datatable. -- Jiri {x2} Cincura I don't understand whay you are saying. How can I cast the added

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-22 Thread Kyris
? Nobuya Higuchi [EMAIL PROTECTED] ?? ??? ?? news:[EMAIL PROTECTED] Try this DataTable dt = new DataTable(); dt.Columns.Add(dtd, System.Type.GetType(System.Byte)); // dtd is the name of the database field K. Result: It produces the same error as in case of

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-22 Thread Nobuya Higuchi
DataTable dt = new DataTable(); dt.Columns.Add(dtd); // dtd is the name of the database field then read the value into string and convert with byte val=byte.Parse(inputstring); I'm sorry but this is exactly where it started. with the single-byte value being '\xA0' byte.Parse(inputstring)

[Firebird-net-provider] how to read a single-byte from databasae

2007-06-21 Thread Nobuya Higuchi
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

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-21 Thread Jiri Cincura
What's your connection string charset? -- Jiri {x2} Cincura http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express

Re: [Firebird-net-provider] how to read a single-byte from databasae

2007-06-21 Thread Nobuya Higuchi
What's your connection string charset? -- Jiri {x2} Cincura CharSet=NONE Regards, Nobuya - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of