0

Hi

I use C# to read excel file.So user has to enter path of the excel file into application.However problem is, if there is null value in excel sheet for particular column then it generate the exception.so i want to create another application that check null ,how do I find the null value in excel sheet.

This is way I get the value ,

String value = worksheet.get_Range(col.columnCode + i, col.columnCode + i).Value2.ToString();

Thanks
Tank50

2
Contributors
2
Replies
7
Views
8 Years
Discussion Span
Last Post by Tank50
0

i didnt get the question clearly though, but if you want to check if string is null or empty, there is a function : string.IsNullOrEmpty

0

HI

Thanks serkan.I got the way how to do that,here is coding

Excel.Range cell1 = (Excel.Range)xlWorkSheet .get_Range("A20", "A20");
            
            if(cell1.Value2==null){
                MessageBox.Show("Null");
            }

Thanks
Tank50

This question has already been answered. 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.