帮帮忙啊!头都大了啊!

解决方案 »

  1.   

    Dim FileLength As Int32
                FileLength = file1.PostedFile.ContentLength
                Dim FileByteArray(FileLength) As Byte
                Dim StreamObject As Stream = file1.PostedFile.InputStream
                StreamObject.Read(FileByteArray, 0, FileLength)
                Dim sqlcon As New SqlConnection("....................")
                Dim sqlcmd As New SqlDataAdapter("select  top 0 * from tablename", sqlcon )
                Dim scb As New SqlCommandBuilder(sqlcmd)
                Dim ds As New DataSet
                sqlcmd.Fill(ds, "tablename")
                Dim dr As DataRow = ds.Tables("tablename").NewRow()
                dr("picdata") = FileByteArray
                ds.Tables("tablename").Rows.Add(dr)
                sqlcmd.Update(ds, "tablename")