0

I have a datatable called datasource that I use to populate a gridview and to use to export the data to a csv file, however for some reason it is leaving the last cell of the last record in the csv blank. Just wondering if anyone has came across this before or knows of any ways to fix this.

Thanks :)

2
Contributors
4
Replies
17
Views
2 Years
Discussion Span
Last Post by coder91
0

it is leaving the last cell of the last record in the csv blank

So the data could be seen in the gridview but when you run the export process, it is missing that last piece of information in the csv file?

0

Yea thats what is happening. The csv is being generated by passing the datatable used to populate the gridview to a memory stream and then exported to csv.

0

Sounds like you arent reading in all of the data or the stream is terminating before you export to csv. could there be someting in the cell to the left that is being read as a delimeter whereby your process thinks its at the end of the row?

0

No I don't think so. It's only causing this error on a few of the csvs. The majority of them are displaying all of the cells. It's very strange.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.