我正在使用C#在网站上工作。我有数据库,其中存储了照片路径。但问题是存储的路径类似于 ... / assets / photo_name.jpg ,而我的资源文件夹中的照片的扩展名为 photo_name.jpeg 。
因此,当我从数据库中获取照片路径并将其放入src中的<img>
标记时,由于.jpg和.jpeg之间的冲突,我无法显示照片。
cmd.CommandText = "SELECT icon FROM `tbl_vc` WHERE is_current = 'Y' AND chancellor =335";
MySqlDataAdapter adp = new MySqlDataAdapter(cmd);
adp.Fill(set);
icon_src ="<img src='"+icon+"' width='331px' height='381px' /> </figure>";
答案 0 :(得分:0)
您可以检查文件是否存在
2016-09-05T10:09:35.549+0000 I COMMAND [conn1243] Command on database config timed out waiting for read concern to be satisfied. Command: { find: "shards", readConcern: { level: "majority", afterOpTime: { ts: Timestamp 1472281864000|2, t: 30 } }, maxTimeMS: 30000 }
2016-09-05T10:09:35.551+0000 I COMMAND [conn1243] command config.$cmd command: find { find: "shards", readConcern: { level: "majority", afterOpTime: { ts: Timestamp 1472281864000|2, t: 30 } }, maxTimeMS: 30000 } keyUpdates:0 writeConflicts:0 numYields:0 reslen:92 locks:{} protocol:op_command 30409ms