![]() |
| ||
| To display an icon in a datagrid Hi 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") |
| ||
| Re: To display an icon in a datagrid I will provide the link: LINK Quote:
|
| ||
| Re: To display an icon in a datagrid Thanks for that piece of code. But Im afraid Im not looking for this....because my project is in VB.NET and not ASP.NET....there is no "itemdatabound" event for datagrid in VB.NET. Please let me know if there is any other way.... |
| ||
| Re: To display an icon in a datagrid Sorry about that...I was not paying attention when I posted that from work. Here is a link to some sample code that may be useful. LINK Hope this helps |
| ||
| Re: To display an icon in a datagrid Thanks for that too...but again this is not what I am lookin for! He is displayin a picture from the app path. I want it from an SQL table.... Any other ideas?! |
| ||
| Re: To display an icon in a datagrid OK, point taken. Here is some further information that I hope will be of more help : LINK LINK 2 snippets: byte[] m_bynewblob = (byte[])myDateSet.Tables["myTable"].Rows[m_iRowID]["Photo"]; This is a perplexing little problem, and I plan to solve it for you...... weekend project. I will let you know what I figure out....if anything. |
| ||
| Re: To display an icon in a datagrid Somehow its not working. I worked on it today, I also used some other concepts like stream and memorystream...but all in vain. The image in the table is not loaded from any physical path. It is an image column having some value like '0x151C2F00020000000D000E0014..........'. It is essentialy small round images having a single color. I donno how the did it because the person who did it is now not part of the project. When I save it to some location using the code provided in the link, I am not able to open those images! The project was in MS Access and is working fine still. I am trying to convert it into VB.NET and all these problems are happening! In my datagrid its showing as "byte[]array" where as in MS Access, the proper image is loaded. Its great to know that you are interested in helping me. Thanks!! Looking forward to more help from you. |
| All times are GMT -4. The time now is 2:19 am. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC