5
Answers

Read data from xml to dataset and shows error out of memory

kamal chhabra

kamal chhabra

9y
1.3k
1
Hi,
 
I have xml file, which can be goes upto 2GB.
i want to convert that xml file to  dataset.  i am using below code
  
DataSet ds = new DataSet();
ds.ReadXml(@"c:\TempFiles\feed.xml");
 
that gives me error
 
"exception of type 'system.outofmemoryexception' was thrown".
 
Please suggest me.
 
 
Thanks
Kamal 
Answers (5)
0
Neeraj Kumar

Neeraj Kumar

NA 9.2k 817.1k 9y
private string hex2binary(string hexvalue)
{
string binaryval = "";
binaryval = Convert.ToString(Convert.ToInt32(hexvalue, 16), 2);
return binaryval;
}
hex2binary("A"); it will return "1010"
hex2binary("1a"); will return "11010";
hex2bianry("1a2c"); will return "1101000101100"
0
Inathi Gqola

Inathi Gqola

NA 177 0 9y
Hi Bilawal, 
 

string Hex = "001";
var s = String.Join("",
Hex.Select(x => Convert.ToString(Convert.ToInt32(x+"", 16), 2).PadLeft(4,'0')))

 
*Google is your friend, my friend..