Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Rendering image in datagrid

Rendering image in datagrid

Scheduled Pinned Locked Moved ASP.NET
databasecsharpsharepointmysqlhardware
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    boyindie
    wrote on last edited by
    #1

    Hi I have got a datagrid which, has an asp:image tag embedded through the columns, i have it pulling in the image url from a database. It does all this succesfully, but it jus won't render the images in the browser, it jus shows my alternative text. Is there somthing i am not doing? do i have to write a method for rendering these, if so how would i go about it? here is my code any help would be great, cheers Boyindie

    'Builds .net mysql connection and passes connection string into method Dim connection As New MySqlConnection(connectionString) 'Open connection to DB connection.Open() 'Create mySql command string for passing query or SPROC(Stored Procedure) Dim cmdString As New MySqlCommand 'Set Command to equal mySql connection, so can pass SQL query cmdString.Connection = connection 'Set command string to equal SPROC cmdString.CommandText = "sp_image" 'ONLY PLACE THIS IF SPROC, sets the command to a SPROC cmdString.CommandType = CommandType.StoredProcedure 'Create dataAdaptor for passing data between .net and mySQL Dim dataAdaptor As New MySqlDataAdapter 'Sets command object to datAdaptor dataAdaptor.SelectCommand = cmdString 'Creates a dataset which will be filled with data from 'dataAdaptor Dim ds As New DataSet dataAdaptor.Fill(ds) 'Creates Table which is filled data from dataset Dim dataTable As New DataTable dataTable = ds.Tables(0) 'Sets datagrids source to datatable dgImage.DataSource

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups