Better way to read Blob from SQL into String / Control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Earl Teigrob

    Better way to read Blob from SQL into String / Control

    I am saving HTML in a SQL Server 2000 Image (blob) field. I need retrieve
    it and render it to the user. Since i have never done this, I was wondering
    what the best way would be to accomplish this. The following code I wrote
    works, but seems quite combersome to me. Is there a better way??? Thanks

    SqlDtr.Read();

    string s="";

    byte[] ByteData = new byte[10000];

    long ArraySize = SqlDtr.GetBytes (0,0, ByteData, 0, 10000);

    for (int i = 0;i<ArraySize;i ++)

    {

    s+=Convert.ToCh ar(ByteData[i]);

    }


Working...