I have a Oracle connection string with SQL Statement:
OracleCommand cmd = new OracleCommand("SELECT * FROM Database WHERE IPADDRESS='10.00.000.000' ORDER BY DATETIME ASC", con);
After loading all data in a dataset I check the bit of the row "RAWOUTPUT1" and write it in the correct column:
int bit = Convert.ToInt32(dr[22]);
dr[24] = (bit & (1 << 0)) != 0;
dr[25] = (bit & (1 << 1)) != 0;
dr[26] = (bit & (1 << 2)) != 0;
dr[27] = (bit & (1 << 3)) != 0;
dr[28] = (bit & (1 << 4)) != 0;
dr[29] = (bit & (1 << 5)) != 0;
dr[30] = (bit & (1 << 6)) != 0;
dr[31] = (bit & (1 << 7)) != 0;
dr[32] = (bit & (1 << 8)) != 0;
dr[33] = (bit & (1 << 9)) != 0;
My problem now is that the data is too big and I get a memory exception. So my idea is to load only the data from the database that I need, something like this:
OracleCommand cmd = new OracleCommand("SELECT * FROM Database WHERE IPADDRESS='10.00.000.000'
AND IF((RAWOUTPUT1 & (1 << 0)) != 0) //here I need help, example for check bit
ORDER BY DATETIME ASC", con);
Thanks for the help!