Imports System.Data.SqlClient
Dim image() As Byte = File.ReadAllBytes(filename)
con = New SqlConnection("Data Source=.\;Initial Catalog=نام دیتا بیس;Integrated Security=True;Pooling=False")
com = New SqlCommand("insert into table1 (name,pic) values (@name,@pic)", con)
con.Open()
com.Parameters.AddWithValue("@name", safefilename)
com.Parameters.AddWithValue("@pic", image)
com.ExecuteNonQuery()
con.Close()