not in condition in vb.net
iam trying to erorr out the records which does not have the extensions of .jpg or .bmp
when i try this it is working like AND condition instead of OR condition. (VB.Net)
If (((Right(Row.ArtFile, 4)) <> ".jpg") Or ((Right(Row.ArtFile, 4)) <> ".bmp")) Then
Row.IsGoodRecord = 2
ErrorDesc += "Art_file should have valid .jpg,.bmp,.gif extensions"
End If
Can some one please help me.
June 24th, 2011 3:16pm
Try this:
If NOT ( (... <> .jpg) AND ( ... <> .bmp) ) THEN
Maybe it needs NOT ( OR )
Todd C - MSCTS SQL Server 2005 - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
June 24th, 2011 3:40pm
and maybe add a
LCase to be sure?
LCase(Right(Row.ArtFile,4)) = ".jpg")
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com
June 24th, 2011 4:26pm
If (((Right(Row.ArtFile, 4)) <> ".jpg") Or ((Right(Row.ArtFile, 4)) <> ".bmp")) Then
Row.IsGoodRecord = 2
ErrorDesc += "Art_file should have valid .jpg,.bmp,.gif extensions"
End If
The logic is flawed.
Try the following:
If NOT (((Right(Row.ArtFile, 4)) = ".jpg") Or ((Right(Row.ArtFile, 4)) = ".bmp")) Then
Row.IsGoodRecord = 2
ErrorDesc += "Art_file should have valid .jpg,.bmp,.gif extensions"
End If
Kalman Toth, SQL Server & Business Intelligence Training; SQL 2008 Grand Slam
Free Windows Admin Tool Kit Click here and download it now
June 30th, 2011 11:15am
If (((Right(Row.ArtFile, 4)) <> ".jpg") Or ((Right(Row.ArtFile, 4)) <> ".bmp")) Then
Row.IsGoodRecord = 2
ErrorDesc += "Art_file should have valid .jpg,.bmp,.gif extensions"
End If
The logic is flawed.
Try the following:
If NOT (((Right(Row.ArtFile, 4)) = ".jpg") Or ((Right(Row.ArtFile, 4)) = ".bmp")) Then
Row.IsGoodRecord = 2
ErrorDesc += "Art_file should have valid .jpg,.bmp,.gif extensions"
End If
Kalman Toth, SQL Server & Business Intelligence Training; SQL 2008 Grand Slam
June 30th, 2011 6:14pm
Hi USE this
If (((Right(Row.ArtFile, 4)) <> ".jpg") and ((Right(Row.ArtFile, 4)) <> ".bmp")) Then
Row.IsGoodRecord = 2
ErrorDesc += "Art_file should have valid .jpg,.bmp,.gif extensions"
End If
Free Windows Admin Tool Kit Click here and download it now
July 1st, 2011 1:59am