怎么样在数据库里面存取图片?
能否给点具体的代码让小第瞧瞧?
能否给点具体的代码让小第瞧瞧?
解决方案 »
- FromStream之后的上传文件不能保存了
- 我用了母版页,现在我在内容页怎么能支持母版页上的myControl事件
- 大伙速度来帮忙看看,,,页面自动跳转的问题。。。。急的上火牙痛,,,
- 文件下载如何用IE直接打开??
- 散分~~终于用正则混到了4裤了~~嘿嘿~
- [在线等]跪求各位大哥.行行好.进来看看.关于visual studio net 2005的问题.
- connectionstring里的workstation id属性 和 datasource属性 有什么区别?
- 数据导出到excel中去
- 问题:在用realone播放realserver 8.0上的MP3时,开头有呲呲声。
- javascript判断
- 如何实现在子页面关闭同时刷新父页面的某个控件?
- 一个服务器端的button添加点击事件,同时也添加脚本点击事件,那个先执行?
====>楼上的你碰到服务商死都不给写权限的吗
加点钱你看他给不给
SqlConnection myConnection = new SqlConnection("Server=at;uid=test;pwd=;database=picTest");
SqlCommand myCommand = new SqlCommand("Select * from picture Where id>1374531", myConnection);
// System.Data.SqlClient.SqlDataReader myDataReader;
myConnection.Open();
SqlDataReader myDataReader;
myDataReader= myCommand.ExecuteReader(CommandBehavior.CloseConnection);
int i=0;
while (myDataReader.Read())
{
Response.Clear();
i++; // Response.ContentType = myDataReader["JPEG"].ToString();
//time, news week, USA today, national geographi, digist reader
System.Web.UI.WebControls.Image imgtemp;
imgtemp=(System.Web.UI.WebControls.Image)this.FindControl("Image"+i);
byte[] MyData= new byte[0];
MyData = (byte[])myDataReader["Picture"];
int ArraySize = new int();
ArraySize = MyData.GetUpperBound(0); FileStream fs = new FileStream(@"C:\winnt\Gone Fishing2.jpg", FileMode.Create , FileAccess.Write);
fs.Write(MyData, 0,ArraySize);
fs.Close();
imgtemp.ImageUrl =@"C:\winnt\Gone Fishing2.jpg"; }