Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8791867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:54:05+00:00 2026-06-13T22:54:05+00:00

I am building a small application. This application stores customer information and customer pictures.

  • 0

I am building a small application. This application stores customer information and customer pictures.
Here I have a problem where I want to show data from datatable to datagridview with pictures. My application does not store the image in a database, but stored in a folder.

So in my database just store image path. But not full path, only the name of the folder or file. I use combine path on each name. It is easier to manage folders if the root directory has been changed compared to if I keep the full path.

For example, if I want to display the image in picture box, I’ll do this.

//consider the record has been selected from table

classDirectory cd = new classDirectory();

// it will check current directory combine application name folder and branch name folder.

string branchFolderPath = cd.getBranchFolderPath(branchName); 

string branchPanelPath = cd.getPanelFolderPath(branchFolderPath,panelName);

string customerPath = cd.getCustomerFolderPath(branchPanelPath,customerID + " - " + customerName);

string customerImage = path.Combine(customerPath,customerPicPath);

picCustomer.Image = new Bitmap(customerImage);

After combine, it will return string “C:\Users\My Name\Documents\My Application Name\Branch Name\Panel Name\1235 – HIDAYAH\Pictures\HIDAYAH – Picture.jpg”

So I can see the pictures.

But, I do not know how to display the data in grid view.

So only so far I’ve just made.

Customer.classDataBinding cdb = new Customer.classDataBinding();

DataTable dataCustomer = cdb._listOfCustomer();

dgvCustomer.DataSource = dataCustomer;

this.dgvCustomer.Columns["Customer Image"].Width = 120; //For a while, this code return the string only.
this.dgvCustomer.Columns["Customer ID"].Width = 120;
this.dgvCustomer.Columns["Name"].Width = 120;
this.dgvCustomer.Columns["Branch"].Width = 120;
this.dgvCustomer.Columns["Panel"].Width = 120;

Code in cdb._listOfCustomer()

  public DataTable _listOfCustomer()
    {
        cs.testConnection();

        DataTable dtCustomer = new DataTable();

        using (SqlConnection conn = new SqlConnection(cs.connString))
        {
            string query = "SELECT tbl_customer.customerPicPath as [Customer Image], tbl_customer.customerID as [Customer ID],tbl_customer.customerName as Name, tbl_branch.branchName as Branch, tbl_panel.panelName as Panel FROM (tbl_branch INNER JOIN tbl_panel ON tbl_branch.branchID = tbl_panel.branchID) INNER JOIN tbl_customer ON tbl_panel.panelID = tbl_customer.panelID;";

            using (SqlDataAdapter adap = new SqlDataAdapter(query, conn))
            {
                adap.Fill(dtCustomer);

            }
        }

        return dtCustomer;

Any suggestion? Hope someone can help me to resolve this problem. Thanks a lot!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:54:06+00:00Added an answer on June 13, 2026 at 10:54 pm

    Are you using the Telerik grid? If so, after you bind the grid, you can hide the column displaying tha path, add a GridViewImageColumn and assign its values by creating the correct path.

    Give this approach a try.

    UPDATE1: here is an example:

     public Form1()
        {
            InitializeComponent();
    
            Random r = new Random();
            DataTable table = new DataTable();
            table.Columns.Add("ID", typeof(int));
            table.Columns.Add("Name", typeof(string));
            table.Columns.Add("ImageName", typeof(string));
    
            table.Rows.Add(1, "Row 1", "copy.png");
            table.Rows.Add(2, "Row 2", "cut.png");
            table.Rows.Add(3, "Row 3", "folder.png");
            table.Rows.Add(4, "Row 4", "help.png");
    
            this.radGridView1.DataSource = table;
    
            radGridView1.Columns["ImageName"].IsVisible = false;
    
            GridViewImageColumn col = new GridViewImageColumn("Image");
            radGridView1.Columns.Add(col);
    
            foreach (GridViewRowInfo row in radGridView1.Rows)
            {
                string path = "..\\..\\"; //here you set your path
                row.Cells["Image"].Value = Image.FromFile( Path.Combine(path, row.Cells["ImageName"].Value.ToString()));
    
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I'm building a small application that will be run daily, pulling data from
I'm building a small Stack Overflow application, but to collect information from Stack Overflow
I have this small application that I'm building as an exercise to learn the
I'm building a small application that pulls statistics from an API I have no
I'm building a small application with Nancy I want to have a kind of
I am building a small administrative application, and I want to use Backbone.js on
I have a small application that I am building a Chat application into, so
I'm building a small Android application, but this is more of a Java question
I'm building small one page application with rails 3.1 mongodb and backbonejs. I have
I am building an application that has to display data received from an external

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.