Hi everyone,
I know how to use OleDB to open up a CSV file and treat it like a database table, but I have a method that is passed a memorystream, which represents the byte array of a CSV file, and I need to use OleDB to read from that. How can I open and connect to that memorystream, like I could with a CSV file on disk?
Thanks.
Loading


Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Jun 13, 2011, 4:49 AM EDT
There is no Provider to connect with the MemoryStream.
Sachin KaliaRank #6,482 · 265 reputationPosted Jun 13, 2011, 5:15 AM EDT
is there any way to convert this stream to datatable.so that i could be able to bind it with any gridview kind of object.
Regards
Sachin Kalia
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Jun 13, 2011, 5:47 AM EDT
You can try to write the CVS file memory stream to cvs file again and connect to OleDB.
Sachin KaliaRank #6,482 · 265 reputationPosted Jun 13, 2011, 11:26 PM EDT
Thanks for your great helpon this.
I used the given below code to read csv via stream.
It might be helpful for someone needed.