OdbcCommand.ExecuteNonQuery returns -1. Help!

Hi everybody,

    I don't where to asked this question in this forum. How do you insert to a column of a table with a blob or binary datatype if there is one, from a byte() datatype What is wrong How can I fixed this I need help. Thanks.

Code:
string sqlText = "Insert table1(id, dataByte) values('" + id + "'," + byteData + ")";

OdbcCommand cmd = new OdbcCommand(sqlText, odConn);

//opening connection here

int iRes = cmd.ExecuteNonQuery();

Result:
  iRes = -1


den2005



Answer this question

OdbcCommand.ExecuteNonQuery returns -1. Help!

  • Stanislav Yudin

    Thanks James for the reply, I have solved this problem of mine I converted the byte() to a Base64 string format and store it as Text in database.


    den2005

  • Oliver Schmidt

    Have you tried using parameters to pass the values through

    James

  • OdbcCommand.ExecuteNonQuery returns -1. Help!