Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obtaining LONG RAW Data (Bytes) from EnterpriseLibrary

I have problem to get image bytes data from oracle. reader("image") always returning 0 length. Is their any workaround? If i used oledb then its working but not working with Microsoft EnterpriseLibrary.

using (IDataReader reader = ExecuteNonQueryOracle(Query)) 
    {
            while (reader.Read) {
                dict("image") = reader("image");
            }
    }
public object ExecuteNonQueryOracle(string Query)
{

        using (dbCommand == CurrentDatabase.GetSqlStringCommand(Query)) {
            dbCommand.CommandType = CommandType.Text;
            return CurrentDatabase.ExecuteReader(dbCommand);
        }

}
like image 577
sal Avatar asked Jul 30 '17 09:07

sal


1 Answers

If the ExecuteNonQuery method is returning 0 then one reason could be quite obvious that your query's where clause doesn't match any row in the table(s).

i got this thread from web this might help

Another case which happened with me was, when i was using Enterprise library Data Application block to execute the Update sql query using ExecuteNonQuery method, I was passing the input parameters using AddInParameter method of the Database object in order which didnt match with the order of parameters in my update sql especially the input parameter in where clause.So once i passed in where clause parameter using AddInParameter in the end of the bunch of AddInParameter clause, the problem solved immediately.

like image 190
midhu458 Avatar answered Nov 14 '22 22:11

midhu458