' I get this error code on runtime A first chance exception of type 'System.InvalidOperationException' occurred in System.Data.dll
vb
Imports System
Imports System.IO
Imports System.Data
Public Class SaveImage
Shared Sub main(ByVal iPath As String)
Dim o As System.IO.FileStream
Dim r As StreamReader
Dim gifFile As String
gifFile = iPath
If Dir(gifFile) = "" Then
Console.Write("Invalid File Path")
Exit Sub
End If
o = New FileStream(gifFile, FileMode.Open, FileAccess.Read, FileShare.Read)
r = New StreamReader(o)
Try
Dim FileByteArray(o.Length - 1) As Byte
o.Read(FileByteArray, 0, o.Length)
Dim Con As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;DataSource=CombatTools.mdb")
Dim Sql As String = "INSERT INTO Ranks (rName,rFilesize,rImage) VALUES (?,?,?)"
Dim Cmd As New System.Data.OleDb.OleDbCommand(Sql, Con)
Cmd.Parameters.Add("@rImage", System.Data.OleDb.OleDbType.Binary, o.Length).Value = FileByteArray
Cmd.Parameters.Add("@rFilesize", System.Data.OleDb.OleDbType.VarChar, 100).Value = o.Length
Cmd.Parameters.Add("@rName", System.Data.OleDb.OleDbType.VarChar, 100).Value = iPath
Con.Open()
Cmd.ExecuteNonQuery()
Con.Close()
Catch ex As Exception
Console.Write(ex.ToString)
End Try
End Sub
End Class
Mod Edit: Please use code tags when posting your code. Code tags are used like so =>

Thanks,
PsychoCoder