Ejemplo n.º 1
0
        /// <summary>
        /// 非Soil图片入库
        /// </summary>
        /// <param name="list_picname"></param>
        public static void InsertPicture(string[] list_picname)
        {
            byte[] buffer = Return_Buffer();
            //string strSql = "insert into MONITOR_PICTURE(INDICATOR_NAME,CROP_CODE,MONITORTIME,PIC_MAP) values(@INDICATOR_NAME,@CROP_CODE,@MONITORTIME,@PIC_MAP)";
            SqlConnection con = DataBaseOperate.getSqlCon();
            SqlCommand    cmd = new SqlCommand("insert_Picture", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@INDICATOR_NAME", list_picname[0]);
            cmd.Parameters.AddWithValue("@CROP_CODE", DataBaseOperate.getCrop_Code(list_picname[1]));
            cmd.Parameters.AddWithValue("@MONITORTIME", Convert.ToDateTime(list_picname[2]).ToShortDateString());
            cmd.Parameters.AddWithValue("@PIC_MAP", buffer);
            cmd.ExecuteNonQuery();
        }