Results 1 to 2 of 2

Thread: Sybase Image

  1. #1
    Join Date
    Feb 2004
    Posts
    1

    Unanswered: Sybase Image

    Hi all !

    I'm working with Sybase.ASEOLEDBProvider.2
    ADO.NET OleDbConnectionobject.

    I'm trying to insert a byte[] to the image field,
    it fails inserting an array size 1000, it insert only the first 255 bytes !!


    m_command.CommandText="insert into myblob values (?)";

    IDataParameter IParam;
    IParam = m_command.CreateParameter();
    IParam.Value = b;
    m_command.Parameters.Add(IParam);

    m_command.ExecuteNonQuery();


    Any one have any suggestion?

    Dalila.

  2. #2
    Join Date
    Feb 2004
    Posts
    1

    Re: Sybase Image

    Originally posted by dalila
    Hi all !

    I'm working with Sybase.ASEOLEDBProvider.2
    ADO.NET OleDbConnectionobject.

    I'm trying to insert a byte[] to the image field,
    it fails inserting an array size 1000, it insert only the first 255 bytes !!


    m_command.CommandText="insert into myblob values (?)";

    IDataParameter IParam;
    IParam = m_command.CreateParameter();
    IParam.Value = b;
    m_command.Parameters.Add(IParam);

    m_command.ExecuteNonQuery();


    Any one have any suggestion?

    Dalila.
    Maybe you could use "writetext" command which sybase supplied.And like this:
    declare @test_tmp varbinary(16)
    insert into myblob values('test')
    select @test_tmp=textptr([your column name]) from myblob where [your primary column name]=@@identity
    writetext myblob.[your column name] @test_tmp '[the content you want to insert]'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •