Click here to Skip to main content
16,005,236 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDynamic Event Pin
Ahmad Adnan4-Aug-07 20:54
Ahmad Adnan4-Aug-07 20:54 
QuestionEncrypt , Decrypt - Query string values Pin
Md Arif4-Aug-07 15:44
Md Arif4-Aug-07 15:44 
QuestionASP.Net Session storing COM object Pin
AntDorr4-Aug-07 11:10
AntDorr4-Aug-07 11:10 
QuestionContentPlaceHolder/ Masterpage Pin
Wardell4-Aug-07 9:33
Wardell4-Aug-07 9:33 
AnswerRe: ContentPlaceHolder/ Masterpage Pin
Sandeep Akhare4-Aug-07 23:56
Sandeep Akhare4-Aug-07 23:56 
QuestionDetermine Mime Type and File Name dynamically [modified] Pin
ASPnoob4-Aug-07 9:07
ASPnoob4-Aug-07 9:07 
AnswerRe: Determine Mime Type and File Name dynamically Pin
Christian Graus4-Aug-07 12:59
protectorChristian Graus4-Aug-07 12:59 
GeneralRe: Determine Mime Type and File Name dynamically [modified] Pin
ASPnoob5-Aug-07 8:44
ASPnoob5-Aug-07 8:44 
Hi Chris, thanks for answering. You said it can't be done but I've found the answer. The following code is what I have found
Dim PictureID As Integer = Convert.ToInt32(Request.QueryString("PictureID"))

  'Connect to the database and bring back the image contents & MIME type for the specified picture
  Using myConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("ImageGalleryConnectionString").ConnectionString)

    Const SQL As String = "SELECT [MIMEType], [ImageData] FROM [Pictures] WHERE [PictureID] = @PictureID"
    Dim myCommand As New SqlCommand(SQL, myConnection)
    myCommand.Parameters.AddWithValue("@PictureID", PictureID)

    myConnection.Open()
    Dim myReader As SqlDataReader = myCommand.ExecuteReader

    If myReader.Read Then
      Response.ContentType = myReader("MIMEType").ToString()
      Response.BinaryWrite(myReader("ImageData"))
    End If

    myReader.Close()
    myConnection.Close()
  End Using

This is what i wanted to do, all I wanted was to retrieve mime type and binary file from the database dynamically. Now I just need to make it work with text doc and write the output to the browser.









-- modified at 17:39 Sunday 5th August, 2007
QuestionDrawing chart from ASP.net2.0 data grid Pin
Malay Mukherjee4-Aug-07 8:18
Malay Mukherjee4-Aug-07 8:18 
AnswerRe: Drawing chart from ASP.net2.0 data grid Pin
Christian Graus4-Aug-07 13:09
protectorChristian Graus4-Aug-07 13:09 
QuestionExporting Data from Sql to Excel worksheet through ASP.net2.0 Pin
Malay Mukherjee4-Aug-07 8:16
Malay Mukherjee4-Aug-07 8:16 
AnswerRe: Exporting Data from Sql to Excel worksheet through ASP.net2.0 Pin
Christian Graus4-Aug-07 13:12
protectorChristian Graus4-Aug-07 13:12 
Questionhttp to https: URL Rewriting Pin
kaliem4-Aug-07 8:02
kaliem4-Aug-07 8:02 
AnswerRe: http to https: URL Rewriting Pin
Christian Graus4-Aug-07 13:16
protectorChristian Graus4-Aug-07 13:16 
QuestionHorizontal Expanding Docking Panel Pin
devil854-Aug-07 7:59
devil854-Aug-07 7:59 
QuestionCascadingDropDown Pin
itzmevishu4-Aug-07 4:32
itzmevishu4-Aug-07 4:32 
QuestionHow to handle multiple browsers in ASP.NET Pin
swapnilbhavsar4-Aug-07 2:28
swapnilbhavsar4-Aug-07 2:28 
AnswerRe: How to handle multiple browsers in ASP.NET Pin
Christian Graus4-Aug-07 3:12
protectorChristian Graus4-Aug-07 3:12 
Questionhow to access one java scrpt in multiple forms Pin
biswa474-Aug-07 1:02
biswa474-Aug-07 1:02 
AnswerRe: how to access one java scrpt in multiple forms Pin
Christian Graus4-Aug-07 3:03
protectorChristian Graus4-Aug-07 3:03 
AnswerRe: how to access one java scrpt in multiple forms Pin
Eliz.k4-Aug-07 4:43
Eliz.k4-Aug-07 4:43 
QuestionIntegration of blogs with asp.net 2.0 Pin
SameerTaha4-Aug-07 0:58
SameerTaha4-Aug-07 0:58 
AnswerRe: Integration of blogs with asp.net 2.0 Pin
Christian Graus4-Aug-07 3:13
protectorChristian Graus4-Aug-07 3:13 
QuestionPostback problem in ItemCommand event of Datagrid Pin
Anees Mitha3-Aug-07 23:30
Anees Mitha3-Aug-07 23:30 
AnswerRe: Postback problem in ItemCommand event of Datagrid Pin
N a v a n e e t h3-Aug-07 23:52
N a v a n e e t h3-Aug-07 23:52 

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.