从经典asp中的对象ole db sql查看图像

问题描述

我正在寻找一种在经典 asp 中显示存储在 sql db 的 ole 对象中的图像的方法。 我已经环顾了一段时间,我发现的唯一一件事就是我已经根据自己的需要重新调整了这样的东西。 然而不幸的是,它不起作用,您只能看到一个带有中心 x 的小方块。 你有什么建议吗? 谢谢

<%@LANGUAGE = VBScript%>

Set Conn1 = Server.CreateObject("ADODB.Connection")
Conn1.open "Driver={sql Server};Server=ARCA;Database=CDB_EVEREX;Uid=everex;Pwd=everex1989;"

Dim strsql,Rs
Set Rs = Server.CreateObject("ADODB.Recordset") 

strsql = "SELECT * FROM Attrezzatura_Catalogo WHERE ID_Catalogo=" & id & ";"
Rs.Open strsql,Conn1,3,1

' Clear out the existing HTTP header information
'Response.Expires = 0
'Response.Buffer = TRUE
'Response.Clear

' Change the HTTP header to reflect that an image is being passed.
Response.ContentType = "image/bmp"

Response.BinaryWrite Rs("Immagine") 
'Response.End

Rs.Close
Conn1.Close
Set Conn1 = nothing

%>

解决方法

确保存储的数据是二进制的,然后试试这个?

<%
Response.ContentType = "image/bmp"
Response.Buffer = True
Response.AddHeader  "Content-Disposition","inline; filename=file001.bmp"
Response.Clear
Response.BinaryWrite Rs("Immagine")
Response.Flush
%>

也许存储的数据可以是 base64。如果data base64则直接输入img src

,

感谢您的回答,我按照您的建议修改了代码(如果我理解正确)尝试了您的建议,但问题没有解决,您总是只能看到带有中心 x 的正方形 :(

df['date_time'] = pd.to_datetime(df['date_time'])    # Ensure the `date_time` column is datetime type

df['just_date'] = df['date_time'].dt.date
df['year'] = df['date_time'].dt.year

idx = df.groupby(['year'])['system_load'].transform(max) == df['system_load']

df[df['just_date'].isin(df[idx]['just_date'])].plot.bar(x='date_time',y='system_load',rot=45)

system_load

%>