//向某预警信息添加图片 public static bool InsertWarningImg(WarningImg ent) { StringBuilder sb = new StringBuilder(); int length = 4; String[] props = new string[length]; SqlDbType[] types = new SqlDbType[length]; Object[] contents = new Object[length]; string tableName = WarningImgDbConstNames.TABLE_NAME; props[0] = WarningImgDbConstNames.IMG_FILENAME; props[1] = WarningImgDbConstNames.WARNING_ID; props[2] = WarningImgDbConstNames.REMARKS; props[3] = WarningImgDbConstNames.IMG; types[0] = SqlDbType.VarChar; types[1] = SqlDbType.VarChar; types[2] = SqlDbType.VarChar; types[3] = SqlDbType.Image; contents[0] = ent.FileName; contents[1] = ent.WarningId; contents[2] = ent.Remarks; contents[3] = ent.Img; //sb.Append("INSERT INTO " + WarningImgDbConstNames.TABLE_NAME + "VALUES"); //sb.Append("('" + ent.FileName + "','" + ent.WarningId + "','" + ent.Remarks + "',"")"); ManageDataBase db = new ManageDataBase(DATABASE_TYPE.WarningManagementDB); db.OperateDBWithPropertys(props, WarningImgDbConstNames.TABLE_NAME, length, types, contents); return(false); }