i have a table and oleobj column in this table. i save some files to oleobj. and i need to open them how i can do that.
for example i save ppt in oleobj and ineed to open this powerpoint file how can i do ..
2nd question.
can i use some files on filesteam or memorystream or something like this?
here are my saving codes
OpenFileDialog1.Title = "Get Image"
With OpenFileDialog1
.Filter = "All Files|*.*|"
.FilterIndex = 1
End With
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
Dim bytes() As Byte
bytes = My.Computer.FileSystem.ReadAllBytes(OpenFileDialog1.FileName)
End If
savefile(OpenFileDialog1.FileName, RTBResim.Text, TSTBindex.Text)
Public Sub savefile(ByVal filepath As String, ByVal açıklama As String, ByVal kişiindex As Integer) ''tamam
Dim bytes() As Byte
Try
bytes = System.IO.File.ReadAllBytes(filepath)
Catch : MsgBox("Bu dosya bulunamadı veya yok")
End Try
Dim sindex As Integer '' its not important
If KayıtStringFile = "&" Then
sindex = Form1.VerilerDataSet.Resimler.Rows.Count
Else
sindex = kayıtidbulma(KayıtStringFotoğraf, KayıtStringFotoğraf)
End If
Dim cmd As New OleDb.OleDbCommand("insert into Resimler (Fileindex,File,Fileinfo) values (" & sindex & ",@File," & açıklama & ")", Form1.cnnctn)
cmd.Parameters.Add("@File", OleDb.OleDbType.Binary, bytes.Length).Value = bytes
Try
cmd.ExecuteNonQuery()
resimindexekle(sindex, kişiindex)' its not important
Dim asdf As DataRow = Form1.VerilerDataSet.Resimler.Rows(0)
asdf(0) = sindex : asdf(1) = bytes : asdf(2) = açıklama
Form1.VerilerDataSet.Resimler.Rows.Add(asdf)
MsgBox("Data save successfully!")
Catch ex As Exception
'' MsgBox("error:" & ex.ToString)
End Try
End Sub ''tamam