Quantcast
Channel: 'If' statement with multiple conditions over multiple lines in VB.net - Stack Overflow
Viewing all articles
Browse latest Browse all 5

'If' statement with multiple conditions over multiple lines in VB.net

$
0
0

I am checking the existence of two files and after that setting a condition but I am getting an error message that the syntax is incorrect when I add the AND

If (System.IO.Directory.GetFiles(CStr(Dts.Variables("VNetworkFolderName").Value), "Z_Attendance.xls").Length > 0and System.IO.Directory.GetFiles(CStr(Dts.Variables("VNetworkFolderName").Value), "Z_EP.xls").Length > 0) Then  Dts.Variables("VCountAPAListFile").Value = TrueElse  Dts.Variables("VCountAPAListFile").Value = FalseEnd If

But if I check just one file without using AND statement, it works fine.


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>