Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 21st, 2005, 08:04 AM
Registered User
 
Join Date: Mar 2005
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default to display an icon in datagrid

I have a dataset which acts as a datasource to my datagrid. It just shows all the columns from a table. One of the columns is an image column. How do i show these icons\pictures on the grid?

My code looks like this:
dim cmd as sqlcommand
dim da as sqldataadapter
dim ds as new dataset

cmd.commandtext = "select * from tbl_auths"
cmd.connection = cn
'assuming connection (cn) to be open
da = New SqlDataAdapter(cmd)
da.Fill(ds,"tbl_auths")
dgrauth.datasource = ds.tables("tbl_auths")
Reply With Quote
  #2 (permalink)  
Old March 24th, 2005, 04:21 AM
Authorized User
 
Join Date: Mar 2005
Location: , , India.
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hy,

for showing image in a datagrid there can b two approaches acc. to me :

1) u can create an 'image type' field in ur database and then make use
   of a bound column. But wot i feel is that this approach can make ur
   database too heavy. so to avoid this u can follow the 2nd app.
2) create an image folder in ur appln. directory.then u can use a
   template column and put an <img> tag there. This <img> tag will
   consist of the src of ur images folder along with the container
   for retrieving ur dataitems. Also ur database will contain an
   image column with any varchar/char datatype.

this shud solve it..
I knw it may sound a bit complicated .. but believe me it's easy :)

ciao...

It bcums FATAL wen my brain puts my eyes on Call-Waiting ! >|B-)
Reply With Quote
  #3 (permalink)  
Old March 24th, 2005, 06:37 AM
Registered User
 
Join Date: Mar 2005
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The table uses an image column which contains some hexadecimal value. In the grid its coming as "Byte[]Array" instead of the real icons. Also my project is in VB.NET and not in ASP.NET. Does the concept of bound columns exist in VB.NET also? Please help

Reply With Quote
  #4 (permalink)  
Old March 24th, 2005, 08:06 AM
Authorized User
 
Join Date: Mar 2005
Location: , , India.
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hy,

this link may b beneficial..
"http://www.vbdotnetforums.com/showthread.php?t=2124"

hth..
ciao..

**************************************************
It bcums FATAL wen my brain puts my eyes on Call-Waiting ! >|B-)
Reply With Quote
  #5 (permalink)  
Old March 30th, 2005, 02:00 AM
Registered User
 
Join Date: Mar 2005
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for sending that link...But the problem is they are using an imagelist. I want it to come directly from the database. So that code wont work!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid icon in Toolbox in VB.NET 2005 dimeanel Visual Basic 2005 Basics 1 April 12th, 2006 09:38 PM
Display icon on a webpage rroohhiitt C# 3 February 24th, 2006 08:12 PM
Display icon and form caption vickyj Beginning VB 6 1 January 31st, 2006 05:55 AM
Selectively showing an icon in datagrid GuyB ASP.NET 1.0 and 1.1 Basics 3 November 25th, 2005 01:19 AM
Datagrid display deadrocker .NET Web Services 1 February 12th, 2005 07:04 AM



All times are GMT -4. The time now is 05:20 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.