1:在SQLSERVER数据库中需要建立什么类型的字段.
2:如何把一个图片上传到数据库中哪,最好给个例子好吗??

解决方案 »

  1.   

    http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=6404
      

  2.   

    How To Read and Write BLOB Data by Using ADO.NET with Visual C# .NET
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;309158
    DataGrid显示图片(物理路径式和Stream流式)和添加图片到数据库
    http://singlepine.cnblogs.com/articles/288027.html
      

  3.   

    在数据层的操作,
    转为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();
      

  4.   

    把图片放在文件中是什么意思??
    是说把文件放在一个文件夹里面,然后把路径赋予imagebox吗???到底怎么样好些哪???