c# - How to view as string when datacolumn[row][0] return system.byte -


the problem related mysql , c#

i have stored procedure returns out put of query query has concatenated columns first column , other individual columns

when access data column dt.rows[i][0] returns system.byte[]

even tried write file write system.byte[] in file

i tried convert byte array using byte[] b= (byte[])dt.rows[i][0];

it gives exception cannot convert string byte[]

i tried add values string in list like

list<string> list = new list<string>();                 foreach (datarow row in dt.rows)                 {                     list.add(row[0].tostring());                 } 

and writing list[i] file writes system.byte[] file

any idea how on come problem

other columns accessed , displayed normally, case first column has cancatenated values multiple columns

like this

select concat ('390', date (t5.inventorydate) ,t5.skuoritem ) pk, t5.customerid, t5.entityid, t5.inventorydate, t5.skuoritem, t5.category, t5.inventory from

haven't tested code ideea. trasform each octet number , cast number char.

int character = 0; int bitvalue = 1; int count = 0; string result = "";  (int = row[0].length - 1; >= 0 ; i--) {     character += row[0][i] * bitvalue;     bitvalue *= 2;     count++;     if(count == 7)     {          count = 0;          character= 0;          bitvalue = 1;          result += (char) character;     } } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -