Código
Dim fsreader As New FileStream("c:\carpeta\foto1.jpg", FileMode.Open, FileAccess.Read) Dim breader As New BinaryReader(fsreader) Dim imgbuffer(fsreader.Length) As Byte breader.Read(imgbuffer, 0, fsreader.Length) fsreader.Close() 'closes the current stream and releases any resources strSQL = "INSERT INTO juegos (titulo,imagen) values (@titulo,@imagen)" strComando.CommandText = strSQL strComando.Connection = strConexion strComando.Parameters.AddWithValue("@titulo", "nuevo metodo") strComando.Parameters.AddWithValue("@imagen", imgbuffer) strComando.ExecuteNonQuery() strComando.Dispose() MsgBox("Saved")
Pero ahora surgió un problemita. tengo un PictureBox en donde le pego el contenido del Clipboard.
Código
If Clipboard.GetDataObject.GetDataPresent("Bitmap") Then PictureBox1.Image = CType(Clipboard.GetDataObject.GetData("Bitmap"), Bitmap) End If
y no se como decirle aca en que ruta esta el archivo por que no esta en el disco.
Código
Dim fsreader As New FileStream("el-problema-esta-aca-que-poner", FileMode.Open, FileAccess.Read)