Hello. Well the pain and swelling in my legs went down today. For that I am grateful. Last night I went through Jean’s Zune and got all the kids music off and set it up all over again. What was suppose to take 20 minutes took over an hour. Was kind of floored.
Anyway we want to load a word document into a SQL BLOB image with vb.net. This is what i came up with. For simplicity, I restricted the code to strictly this task which was a little difficult itself. Have a good day!
Dim MyStream As New FileStream("C:\My.doc",FileMode.Open) Dim DocLen As Integer = New FileInfo("C:\My.doc").Length Dim MyBlob(DocLen) As Byte Dim n As Integer = MyStream.Read(MyBlob,0,DocLen) Dim MySql As Sting = "INSERT INTO MyBlobTable (MyId,MyBlob) VALUES (1,@MyBlob)" Dim sql As New SqlCommand(MySql,MyConn) Dim sqlp As New SqlParameter("@MyBlob",SqlDbType.Image) sqlp.Value = MyBlob sql.Parameters.Add(sqlp)