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

Recommended Answers

All 2 Replies

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.