sub imageout(sender as object, e as eventargs)
objconn.connectionstring="provider=microsoft.jet.oledb.4.0;" & "data source=" & server.mappath("db1.mdb")
objconn.open()
sqlstring="select * from imagetable where imagename='"& mydrop.selecteditem.text &"'"
objcomm=new oledbcommand(sqlstring,objconn)
objcmd=new oledbdataadapter(objcomm)
objcmd.fill(ds,"imagetypetable")
dim mytable as datatable=ds.tables("imagetypetable")
'dim objreader as oledbdatareader=objcomm.executereader()
if mytable.rows.count<>0 then
'response.contenttype="audio/x-mpeg"
response.contenttype=mytable.rows(0).item("imagetype")
response.binarywrite((ctype(mytable.rows(0)("imagedata"),byte())))
end if
objconn.close()
end sub
这是代码,可是读出的媒体文件已损坏.请各位大侠指点指点!!!!
objconn.connectionstring="provider=microsoft.jet.oledb.4.0;" & "data source=" & server.mappath("db1.mdb")
objconn.open()
sqlstring="select * from imagetable where imagename='"& mydrop.selecteditem.text &"'"
objcomm=new oledbcommand(sqlstring,objconn)
objcmd=new oledbdataadapter(objcomm)
objcmd.fill(ds,"imagetypetable")
dim mytable as datatable=ds.tables("imagetypetable")
'dim objreader as oledbdatareader=objcomm.executereader()
if mytable.rows.count<>0 then
'response.contenttype="audio/x-mpeg"
response.contenttype=mytable.rows(0).item("imagetype")
response.binarywrite((ctype(mytable.rows(0)("imagedata"),byte())))
end if
objconn.close()
end sub
这是代码,可是读出的媒体文件已损坏.请各位大侠指点指点!!!!