转为byte类型后存入Image字段。
byte[] imagebytes=null;
FileStream fs=new FileStream(Image_path,FileMode.Open);
BinaryReader br=new BinaryReader(fs);
imagebytes=br.ReadBytes(br.Length);
SqlParameter parInput22=cmd.Parameters.Add("@员工图片",SqlDbType.Image);
parInput22.Direction=ParameterDirection.Input;
cmd.Parameters["@员工图片"].Value=imagebytes;
cmd.ExecuteNonQuery();
byte[] imagebytes=null;
FileStream fs=new FileStream(Image_path,FileMode.Open);
BinaryReader br=new BinaryReader(fs);
imagebytes=br.ReadBytes(br.Length);
SqlParameter parInput22=cmd.Parameters.Add("@员工图片",SqlDbType.Image);
parInput22.Direction=ParameterDirection.Input;
cmd.Parameters["@员工图片"].Value=imagebytes;
cmd.ExecuteNonQuery();
解决方案 »
- 提问 C# 如何创建Oracle数据库
- 求教分析IIS日志的方法
- myclass.Name 不可访问 因为是受保护级别限制
- vs2005有没有控件提示?移到上面就显示控件名称之类的信息
- winform多语言实现?
- 查询,charindex相关,一句sql语句
- 关于针对网上邻居传送文件指定软件方案
- Point[] pt=new Point[7]{Point……出错啦
- 如何在NumberUpDown控件中设置tooltip显示?
- 已知datagrid的列名称,如何得到它的列索引(列号)
- 请问如何在不知道多少个点的情况下绘制多边形????
- 请问如何像foxmail一样把IE内嵌在窗体中浏览邮件啊??急!!
http://support.microsoft.com/default.aspx?scid=kb;EN-US;309158
数据库中操作图片
http://dotnet.aspx.cc/ShowDetail.aspx?id=EY1XLDYV-PIDF-43LO-1WFL-FMY5ALE1F635