Now while this example is in VB i'm fine with either.
Expand|Select|Wrap|Line Numbers
- Sub Page_Load(sender as object, e as EventArgs)
- Dim objConn As New SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("GstImg01").ConnectionString)
- Dim cmdText = "SELECT contenttype, filename, filedata, length FROM proj_file WHERE id='" & Request.QueryString("id") & "'"
- Dim objcmd As New SqlClient.SqlCommand(cmdText, objConn)
- objConn.Open()
- Dim objread As SqlClient.SqlDataReader = objcmd.ExecuteReader()
- Response.Clear()
- If objread.Read() Then
- Response.ContentType = objread("contenttype").ToString()
- Response.ContentType = objread("filename").ToCharArray()
- Response.ContentType = objread("length").ToString()
- Response.BinaryWrite(CType(objread("filedata"), Byte()))
- End If
- objConn.Close()
- End Sub
Maybe some one out there has a solution?
Thanks
Tim