If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > Text field problem with .NET

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-03, 11:01
Ed_Sujecki Ed_Sujecki is offline
Registered User
 
Join Date: Mar 2003
Posts: 1
Text field problem with .NET

I am having problems retrieving data from a text field from my Sybase ASE using ASP.NET. I am using the ASE OLE DB Provider instead of going through ODBC. When I try to retrieve data from the text field, it just returns unreadable characters. I have tried both the GetChars and GetBytes methods on my OleDbDataReader. THe GetBytes method throws a InvalidCastException, and the GetChars method returns the unreadable data. Here is the code I am using (theData is my OleDbDataReader) ....

int blobSize;
char[] buffer;

blobSize = (int)theData.GetChars(i, 0, null, 0, 0);
buffer = new char[blobSize];
theData.GetChars(i, 0, buffer, 0, blobSize);
theValue = new String(buffer);

Any help would be appreciated.

Ed
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On