Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

Alessandro

@Alessandro
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to download binary file from SQL SERVER to VB.NET
    A Alessandro

    Put this code in your page

                   Dim oAttachment As New GetAttach
                    Try
                        Me.Page.Response.Clear()
                        Me.Page.Response.ClearContent()
                        Me.Page.Response.ClearHeaders()
                        Response.ContentType = ""
                        Response.BinaryWrite(oAttachment.GetAttach())
                        Response.AddHeader("content-disposition", "attachment; filename=" + oAttachment.ATTACH\_NAME + "." + oAttachment.EXTENSION)
                        Me.Page.Response.End()
                    Catch ex As Exception
                        throw ex
                    End Try
    

    GetAttach Class to call getter stored procedure

    Public Function GetAttach(ByVal MyParameter As Integer)
    Dim docFileReader As SqlDataReader

        Try
    
            Dim Myadapter As New SqlDataAdapter
    
            Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
                Using command As New SqlCommand("GetAttachment", connection)
                    command.CommandType = CommandType.StoredProcedure
                    command.Parameters.Add(New SqlParameter("@MY\_SP\_PARAMETER", MyParameter))
                    connection.Open()
                    docFileReader = command.ExecuteReader
                    docFileReader.Read()
                    EXTENSION = docFileReader.Item("EXTENSION").ToString
                    ATTACH\_NAME = docFileReader.Item("ATTACH\_NAME").ToString
                    WEIGHT = docFileReader.Item("WEIGHT").ToString
                    Dim FileData(docFileReader.GetBytes(0, 0, Nothing, 0, Integer.MaxValue) - 1) As Byte
                    docFileReader.GetBytes(0, 0, FileData, 0, FileData.Length)
                    docFileReader.Close()
    
                    Return FileData
    
                End Using
            End Using
    
        Catch ex As Exception
            If IsNothing(docFileReader) = False Then
                docFileReader.Close()
            End If
            Throw ex
        End Try
    
    End Function
    
    Visual Basic csharp asp-net database sql-server

  • 3D Bitmaps
    A Alessandro

    eheheh right Xint0 ;)

    Algorithms help graphics algorithms question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups