What is this error telling me I am doing wrong.

I am using this code in a script that uploads files to an SQL 2008 server. It produces an error that I can not figure out. What is this error telling me I am doing wrong. As far as I know I am passing these values in my script.

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

This is a project that I am moving from my VS10 development environment into VS11 Beta DE. while tweaking my classes. I did not figure out what caused the error but when I reimported my bits from VS10 into VS11 and made my changes incrementally I did not end up with the error. Thank you all for your responses

I figured out that the upload process fails when I check "IsImage". When I comment that line then the the process completes successfully I have no ides why this happens

If filePath.InputStream.Length > -1 Then
_fileData = filePath.InputStream
If IsImage(_fileData) = False Then
Exit Sub
End If
...
End If

Private Function IsImage(file As Stream) As Boolean
Using bitmap As New Bitmap(file, False)
If bitmap.RawFormat.Equals(ImageFormat.Bmp) Then
Return True
Exit Function
End If
If bitmap.RawFormat.Equals(ImageFormat.Jpeg) Then
Return True
Exit Function
End If
If bitmap.RawFormat.Equals(ImageFormat.Gif) Then
Return True
Exit Function
End If
If bitmap.RawFormat.Equals(ImageFormat.Png) Then
Return True
Exit Function
End If
If bitmap.RawFormat.Equals(ImageFormat.Tiff) Then
Return True
Exit Function
End If
If bitmap.RawFormat.Equals(ImageFormat.Icon) Then
Return True
Exit Function
End If