Click here to Skip to main content
15,888,320 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Dim arrimage() As Byte
      Dim oledb_Conn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\shanky.gupta\Desktop\manish.mdb")
      Dim cmd As New OleDb.OleDbCommand("select * from omsstaticcontent", oledb_Conn)
      oledb_Conn.Open()
      Using fs As FileStream = New FileStream("C:\Users\Public\Pictures\Sample Pictures\WatchFolder.jpg", FileMode.Open, FileAccess.Read, FileShare.Read)
          ReDim arrimage(fs.Length)
          fs.Read(arrimage, 0, fs.Length)
      End Using
      cmd.CommandText = "insert into omsstaticcontent(categoryid,communicationgroupid,reportid,imagepath,filetype,file) values(22,1,1,'C:\Users\Public\Pictures\Sample Pictures\WatchFolder.jpg','I','?')"
      cmd.Parameters.Add("?", OleDb.OleDbType.Binary, arrimage.Length).Value = arrimage
      cmd.ExecuteNonQuery()

      Dim da As New OleDb.OleDbDataAdapter("select * from omsstaticcontent where categoryid=22", oledb_Conn)

      Dim ds As New DataSet
      da.Fill(ds)
Posted
Comments
Richard Deeming 5-Nov-15 9:15am    
"Issues" is not enough information for us to know what's going wrong, let alone diagnose the problem.

Use the "Improve question" button to update your question with a clear description of the problem. Don't forget to include the full details of any exceptions thrown.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900