ÈçºÎ¼ÓÔØÍ¼Æ¬ÔÚsql serverÖÐ
ÎÒ²»ÖªµÀÈçºÎÔÚsql serverÖд洢ͼƬ£¬ÄÇλ¸øÎÒ×ÐϸµÄ½²Ò»Ï²½Öè¡£
²»Òª´æbitÐÍÔÚÊý¾Ý¿âÖÐ,´æÂ·¾¶¾Í¿ÉÒÔÁË
ÕâÑùÏîÄ¿½¨Ò»¸öÎļþ¼ÐÏÂ,ûÓÐͼƬ¶¼Óз¾¶ÁË´æÆðÀ´
±£´æÂ·¾¶µ½Êý¾Ý¿â
»ò±£´æ¶þ½øÖƵ½µ½Image×Ö¶Î
using(SqlConnection conn=new SqlConnection(ConnectString))
{
conn.Open();
string strsql = "select photo from testimage where id=" + Request.QueryString["id"];
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = strsql;
SqlDataReader rd = cmd.ExecuteReader();
byte[] data = null;
if (rd.Read())
{
Response.Clear();
data = (byte[])rd["photo"];
Response.BinaryWrite(data);
Response.End();
}
}
Stream ImageStream;
string Path = FileUpload1.PostedFile.FileName;
int Size = FileUpload1.PostedFile.ContentLength;
string Type = FileUpload1.PostedFile.ContentType;
ImageStream = FileUplo
Ïà¹ØÎÊ´ð£º
±¾ÈËc#ÐÂÊÖ ¿ÉÊÇÒªÇóÒªÓÃc# £¬sql2000¿ª·¢c/sµÄ¹¤×÷Á÷£¬Ò»Í·ÎíË®£¬Çë´ó¼Ò°ïæ°ï棬¸øµã˼·£¬ËµµÄÔ¼¾ßÌåÔ½ºÃ£¬ÎÒÒ²ºÃÍùÄǸö·½ÃæÈ¥Ñ§Ï°
http://www.hxzi.com/view/61402.html
B/S°æµÄ£¬»ù±¾Ë¼ÏëÓ¦¸Ã²î²»¶àµÄ¡£¡£ ......
sql table±íÓиöÎı¾ÀàÐ͵Äa×ֶΣ¬´æ´¢µÄÄÚÈÝÈ«²¿ÊÇÊý×Ö£¬ÀýÈç2009001£¬2008578ÕâÑùµÄ¸ñʽ£»b×Ö¶ÎÎı¾ÀàÐÍ£¬´æµÄÒ²ÊÇÊý×ÖÀýÈç 001£¬123
aspÀïÃæ strday=100£¬strb=001
ÎÒÏë¶Á³ö£¬´Óa×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......
СµÜÊǸöÐÂÊÖ ÏÖÔÚÓиöÎÊÌâÒ»Ö±²»Äܽâ¾ö
ÀýÈç
procedure produce_proc
@p001 nvarchar(8000),
@p002 nvarchar(8000),
@p003 nvarchar(8000),
& ......
Á½ÖÖ´íÎó£º
1.Èç¹ûÎÒÕâÑùÉêÃ÷£ºResultSet rs;´íÎóÌáʾÈçÏ£º
An error occurred at line: 51 in the jsp file: /index.jsp
The local variable rs may not have been initialized
48: ......