5
Answers

How to replace empty column as "ND" using ASP.NET C#?

Raja

Raja

8y
339
1
I want to set value for particular empty column in data set data table as "ND" in data set.
How to do it?
 
 What I have tried:
 
if (ds.Tables[s].Rows[i][Columncountvalue + 19].ToString().Trim() == "")
 {
ds.Tables[s].Rows[i][Columncountvalue + 19].ToString().Trim().Replace("", "ND");
 }
 the above code is i tried to fill the empty column as "ND" in dataset data table but below error is occurs

string cannot be of zero length. parameter name oldvalue
Answers (5)
0
Prateek Singla

Prateek Singla

NA 558 859 8y
 Hi Raja,
 
 Use Closedxml for reading and writting excel file it is quite easy to use 
 
https://closedxml.codeplex.com/wikipage?title=Showcase&referringTitle=Home
 
https://closedxml.codeplex.com/documentation