简体   繁体   English

使用asp.net gridview和c#从php myadmin数据库显示图像

[英]displaying image from php myadmin database using asp.net gridview and c#

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

the first pictures shows that the address is saved on my database. 第一张图片显示该地址已保存在我的数据库中。 the 2nd shows my declaration of "product_image" on my database. 第二个显示我在数据库中声明的“ product_image”。 the 3rd is the how i print the image on my gridview. 第三是如何在gridview上打印图像。 and the 4th is the result. 结果是第四 there is no image of the picture that i called. 没有我叫过的图片的图像。 help me please. 请帮帮我。 thanks. 谢谢。 :) :)

The problem is, Here you are storing Physical path into database that's why it is creating problem, when you are providing full path like C:\\user\\xx\\xx the asp.net application is not able to find those Images,Also this will create problem when you will deploy your application on production.The solution is to store Relative path based on current directory into database. 问题是,在这里您将物理路径存储到数据库中,这就是它造成问题的原因,当您提供完整路径(例如C:\\user\\xx\\xx ,asp.net应用程序无法找到那些图像,这也会在将应用程序部署到生产环境时会产生问题。解决方案是将基于当前目录的相对路径存储到数据库中。 Use this link for more information 使用此链接了解更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM