码迷,mamicode.com
首页 > 数据库 > 详细

获得数据库image图片二进制

时间:2016-08-30 10:57:45      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:

        /// <summary>
        /// 获得图片二进制
        /// </summary>
        /// <param name="unit_sn">登录用户名</param>
        /// <returns></returns>
        public string GetNameImageFromEmr(string unit_sn)
        {
           
            string sqlCMD = string.Format("Select User_Name_Pic From user_pic Where unit_sn=‘{0}‘", unit_sn);
            DataTable dt = SqlDBHelper.ExcuteDataTable(sqlCMD);
            foreach (DataRow row in dt.Rows)
            {
                foreach (DataColumn col in dt.Columns)
                {
                    object obj = row["User_Name_Pic"];
                    byte[] dd = (byte[])obj;
                    string val = BitConverter.ToString(dd).Replace("-", "");
                    Console.WriteLine(val);
                    return val;
                }
               
            }
            return "";
        }

获得数据库image图片二进制

标签:

原文地址:http://www.cnblogs.com/zhangxiaolei521/p/5820879.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!