Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# PostgreSQL
hello if you can help me or advise me something
i have table named droducts;
insert into products values('a1',45,'ds','C:\Documents and Settings\AdministratorDesktop\1454251_5.jpg');
 
and i want to see my datas in my datagridviewer1
but there is errot it shows evry row except image and there is error.
my code is
 
************************************
private DataSet ds = new DataSet();
 
        private DataTable dt = new DataTable();
        private DataSet dss = new DataSet();
        private DataTable dtt = new DataTable();
********************************
 
                NpgsqlCommand command = connection.CreateCommand();
                NpgsqlDataReader Reader;
                connection.Open();
                string commanda = "SELECT * FROM products";
 
                NpgsqlDataAdapter da = new NpgsqlDataAdapter(commanda, conn);
 
                ds.Reset();
                da.Fill(ds);
                dt = ds.Tables[0];
                dataGridView2.DataSource = dt;
 
please hepl me...
Posted 20-Mar-12 4:23am
Edited 20-Mar-12 5:30am
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Well, you are saving the image path to the database and not the image itself. When the data comes back from the database to fill the adapter, it is just a string with the path, and has no idea that it is supposed to be an image.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

aha it is clear... but what do i can in order to do this? i want image in my datagrid... which will be in my database...:(
  Permalink  
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 319
2 CPallini 275
3 DamithSL 214
4 Maciej Los 185
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 20 Mar 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100