displaying image from php myadmin database using asp.net gridview and c# - c#

the first pictures shows that the address is saved on my database. the 2nd shows my declaration of "product_image" on my database. the 3rd is the how i print the image on my 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. Use this link for more information

Related

SharePoint File is being downloaded instead of being displayed

I got an ASPX file on my Sharepoint. It's supposed to display some simple tables after clicking on it, but instead of it, it's being downloaded to my PC.
There is another file like that in my other folder and it works perfectly fine.
Could anyone give me some advice, how could I fix this problem, please?
Best regards
If the Aspx file is located in Site Pages or Pages library, it should display data directly rather than download if clicking it.
For this issue I suggest you can create a new site page and insert your custom JavaScript logic into the new created page, it should be able to display directly.

Email Images are not getting rendered.

My emails have images that come from database.
So, when I change the images the Images that are shown on my email will change
but the problem is that the images that are displayed are still the old one.
But If I go into the DOM and copy the src of the image and paste it into the address bar the downloaded image is the new image.
Its like there is some sort of cache problem or something. So I cleared the system cache but the image rendered is still the old one
Check these things
1. Server side - Are you clearing all the objects after sending the data to the client?
2. Client side - try by clearing the cache or Make sure you are having images with different names
Suggestion: Please update your question with client side and server side code so that we can guide you better.
It is not a cache problem. In .NET framework there is a copy of the database which gets created at your end to fetch the data at runtime. Due to this you're not getting the updated images from the DB.
To get the updated images, make sure your code accesses the database and fetches the images EVERY-TIME you need.
The key is to get the data directly from the database before displaying.
Also, provide more details for better solutions.

ADO.NET Project

I'm trying to create a project which is basically a library management system.
As a display I used the standard DataSource to WinForm drag and drop system, which displays everything shown in the SQL table.
I want the users to be able to see the content of each row in the grid by double clicking it, which would redirect to another page with the selected row number and information to be displayed on each field.
As for the admin side, I want to be able to modify my db (delete, insert).
Is this the right path, or should I draw a grid from scratch?
Also, my SQL table contains images, this is what's bugging me.
The default gridview shows the little red X's in the varbinary column, and I can't seem to get rid of that.
Regarding inserting data into the table, is there any way to add images directly from the system above? Or should I redirect to a new page and code the respective into textboxes and things of the sort?
Thank you in advance.

adding a image to access database in C#

sir can you explain me how add image to access database through the C# gui application. for an example we have one gui application.in that there is a picture box and add button.once we click add, it should ask the location of picture. once we select the the photo. then it should be stored in access database. i am having a big problem in that please help me.
Manoj you can store images in access as an OLE field
a detail tutorial

Display specific image from SQL database with image control

I have a search page that a user can use to search for certain information about a device (ex. computer) that has been entered into a SQL database. They can search for Brand, Type, Hard Drive Capacity and other things. Once they click the search button, results are displayed in a repeater control. The DeviceID for each device is clickable and when clicked, it takes the user to another page that has all the details about that certain device. I want to be able to display the image for that certain device on that page, as well as all the other information. I have the image being saved as Image type in my SQL database. But I can't figure out how to get it out of my database and display it on the page. I've tried a few different approaches including displaying it in a grid control, which didn't work. I also tried using ASHX files but couldn't quite figure that one out either. I am using C# and ASP.NET. Any help would be greatly appreciated. If any code is needed, please let me know and I will be glad to post it. Thanks!
First hit on Google:
Retrieve Images from a SQL database for display in an Asp.Net Datagrid
Was able to solve this kind of issue using a Handler (ASHX). there are a lot of samples online. try this .. http://www.aspdotnetcodes.com/Insert_Images_Database.aspx

Categories