Home All Groups Group Topic Archive Search About

Sybase and OleDBDataReader problem

Author
8 Dec 2004 7:50 PM
SRLoka
I am using OleDBDataReader with Sybase Anywhere 8 like

SQL = "select disclaimer, about from company";
_cmd = new OleDbCommand(SQL,_cn);
_dr = _cmd.ExecuteReader(System.Data.CommandBehavior.KeyInfo);

The disclaimer is a varchar(1024) field. When I read back the value (I am
using C#)
string s = _dr[0].ToString();
its returning the value thats in the database but with the last character
replace by "\0".

To check where it would start doing that I tested with various numbers and
found that 200 is the limit
If I do LEFT(disclaimer,200) as char(200)), there is no "\0"
If I do LEFT(disclaimer,201) as char(201)), there is a "\0"
Can any please suggest what is wrong here ?

Thanks in advance

Srinivas

AddThis Social Bookmark Button