Click here to Skip to main content
15,892,537 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Postback problem in ItemCommand event of Datagrid Pin
N a v a n e e t h5-Aug-07 22:27
N a v a n e e t h5-Aug-07 22:27 
GeneralRe: Postback problem in ItemCommand event of Datagrid Pin
Anees Mitha7-Aug-07 0:26
Anees Mitha7-Aug-07 0:26 
QuestionSession Checking In Class File Pin
N a v a n e e t h3-Aug-07 22:58
N a v a n e e t h3-Aug-07 22:58 
AnswerRe: Session Checking In Class File Pin
Nicejith4-Aug-07 0:35
Nicejith4-Aug-07 0:35 
GeneralRe: Session Checking In Class File Pin
N a v a n e e t h4-Aug-07 0:43
N a v a n e e t h4-Aug-07 0:43 
AnswerRe: Session Checking In Class File Pin
_mubashir4-Aug-07 0:41
_mubashir4-Aug-07 0:41 
GeneralRe: Session Checking In Class File Pin
N a v a n e e t h4-Aug-07 0:47
N a v a n e e t h4-Aug-07 0:47 
QuestionDisplaying Binary data with Response.Write() [modified] Pin
ASPnoob3-Aug-07 22:19
ASPnoob3-Aug-07 22:19 
Hi, I have been working on this for over two weeks and its not working. I don't know what else to do since I'm really green at this. I'm trying to display binary data from a database using Response.Write(). Please take a look to see where I went wrong, thank you in advance for your help.
Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    Dim DBConn As OdbcConnection

    Dim DBCommand As OdbcCommand


    Dim DS As New DataSet
    If Not LBoxProfessions.SelectedItem Is Nothing Then
        DBConn = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=myDB;Database=myDB;User=myUser;Password=myPW;Option=3;")

        DBCommand = New OdbcCommand("Select ResumeID,Resumes,DocType, from tb_content where Professions = '" & LBoxProfessions.SelectedItem.Text & "' Limit 10 Offset 10", DBConn)

        DBConn.Open()

        Dim AD As OdbcDataReader = DBCOmmand.ExecuteReader()

        If (AD.Read()) Then

            Dim contentLength As Integer = Convert.ToInt32(AD.GetBytes(0, 0, Nothing, 0, Integer.MaxValue))
            Dim buffer As Byte() = New Byte(contentLength - 1) {}
            AD.GetBytes(0, 0, buffer, 0, contentLength)



           'Resumes is the field in the database table that holds the documents
            Response.AddHeader("Content-Disposition", "attachment;filename=Resumes")

            'DocType is the field that holds the mime types
            Response.ContentType = DirectCast(AD("DocType"), String)

            Response.BinaryWrite(buffer)
            Response.End()
        End If
        DBConn.Close()
    End If

End Sub










-- modified at 5:11 Saturday 4th August, 2007
AnswerRe: Displaying Binary data with Response.Write() Pin
Christian Graus3-Aug-07 22:24
protectorChristian Graus3-Aug-07 22:24 
GeneralRe: Displaying Binary data with Response.Write() [modified] Pin
ASPnoob3-Aug-07 22:54
ASPnoob3-Aug-07 22:54 
GeneralRe: Displaying Binary data with Response.Write() Pin
Christian Graus4-Aug-07 0:45
protectorChristian Graus4-Aug-07 0:45 
QuestionOut of memory or system resources problem Pin
pjc*3-Aug-07 22:14
pjc*3-Aug-07 22:14 
QuestionImage gallery Pin
Vipin.d3-Aug-07 21:28
Vipin.d3-Aug-07 21:28 
AnswerRe: Image gallery Pin
Christian Graus3-Aug-07 21:30
protectorChristian Graus3-Aug-07 21:30 
GeneralRe: Image gallery Pin
Vipin.d3-Aug-07 22:37
Vipin.d3-Aug-07 22:37 
GeneralRe: Image gallery Pin
Christian Graus4-Aug-07 0:44
protectorChristian Graus4-Aug-07 0:44 
GeneralRe: Image gallery Pin
Vipin.d4-Aug-07 1:25
Vipin.d4-Aug-07 1:25 
AnswerRe: Image gallery Pin
sulabh20203-Aug-07 21:47
sulabh20203-Aug-07 21:47 
GeneralRe: Image gallery Pin
Vipin.d3-Aug-07 22:40
Vipin.d3-Aug-07 22:40 
GeneralRe: Image gallery Pin
Christian Graus4-Aug-07 0:46
protectorChristian Graus4-Aug-07 0:46 
AnswerRe: Image gallery Pin
Vipin.d4-Aug-07 2:45
Vipin.d4-Aug-07 2:45 
QuestionDatabase Connectivity !! Pin
shweta@syscom3-Aug-07 20:23
shweta@syscom3-Aug-07 20:23 
AnswerRe: Database Connectivity !! Pin
Christian Graus3-Aug-07 21:20
protectorChristian Graus3-Aug-07 21:20 
AnswerRe: Database Connectivity !! [modified] Pin
manowj3-Aug-07 21:21
manowj3-Aug-07 21:21 
GeneralRe: Database Connectivity !! Pin
Christian Graus3-Aug-07 21:30
protectorChristian Graus3-Aug-07 21:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.