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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Need Help

Need Help

Scheduled Pinned Locked Moved ASP.NET
cssdatabasedesignhelptutorial
2 Posts 2 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.
  • L Offline
    L Offline
    learningman
    wrote on last edited by
    #1

    I have a classifieds data table and a dal and a bll all writtin in vb and I have a detailsview that inserts into the database and then show the data with a gridview.everything works ok except.. the image will not show in the grid can anyone give me an example .. when my gridview shows the data the image shows a box with a red x in it here is some of the code i have the insert classifieds bll <System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, True)> _ Public Sub InsertClassifieds(ByVal category As String, ByVal itemName As String, ByVal description As String, ByVal Price As Integer, ByVal EmailAddress As String, ByVal PhoneNumber As String, ByVal dateListed As Date, ByVal MIMEType As String, ByVal imageData() As Byte) Adapter.InsertClassifieds(category, itemName, description, Price, EmailAddress, PhoneNumber, dateListed, MIMEType, imageData) End Sub the classifieds vb Imports System.IO Partial Class Classifieds Inherits System.Web.UI.Page Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) 'If Cancel button is clicked, send user to Default Response.Redirect("~/Classifieds.aspx") End Sub Protected Sub UploadPictureUI_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles UploadPictureUI.ItemInserting 'Reference the FileUpload control Dim UploadClassifieds As FileUpload = CType(UploadPictureUI.FindControl("UploadClassifieds"), FileUpload) 'Make sure a file has been successfully uploaded If UploadClassifieds.PostedFile Is Nothing OrElse String.IsNullOrEmpty(UploadClassifieds.PostedFile.FileName) OrElse UploadClassifieds.PostedFile.InputStream Is Nothing Then e.Cancel = True Exit Sub End If 'Make sure we are dealing with a JPG or GIF file Dim extension As String = Path.GetExtension(UploadClassifieds.PostedFile.FileName).ToLower() Dim MIMEType As String = Nothing Select Case extension Case ".gif" MIMEType = "image/gif" Case ".jpg", ".jpeg", ".jpe" MIMEType = "image/jpeg" Case ".png" MIMEType = "image/png" Case Else 'Invalid file type uploaded e.Cancel = True Exit Sub End Select 'Specify the values for the MIMEType and Ima

    L 1 Reply Last reply
    0
    • L learningman

      I have a classifieds data table and a dal and a bll all writtin in vb and I have a detailsview that inserts into the database and then show the data with a gridview.everything works ok except.. the image will not show in the grid can anyone give me an example .. when my gridview shows the data the image shows a box with a red x in it here is some of the code i have the insert classifieds bll <System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, True)> _ Public Sub InsertClassifieds(ByVal category As String, ByVal itemName As String, ByVal description As String, ByVal Price As Integer, ByVal EmailAddress As String, ByVal PhoneNumber As String, ByVal dateListed As Date, ByVal MIMEType As String, ByVal imageData() As Byte) Adapter.InsertClassifieds(category, itemName, description, Price, EmailAddress, PhoneNumber, dateListed, MIMEType, imageData) End Sub the classifieds vb Imports System.IO Partial Class Classifieds Inherits System.Web.UI.Page Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) 'If Cancel button is clicked, send user to Default Response.Redirect("~/Classifieds.aspx") End Sub Protected Sub UploadPictureUI_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles UploadPictureUI.ItemInserting 'Reference the FileUpload control Dim UploadClassifieds As FileUpload = CType(UploadPictureUI.FindControl("UploadClassifieds"), FileUpload) 'Make sure a file has been successfully uploaded If UploadClassifieds.PostedFile Is Nothing OrElse String.IsNullOrEmpty(UploadClassifieds.PostedFile.FileName) OrElse UploadClassifieds.PostedFile.InputStream Is Nothing Then e.Cancel = True Exit Sub End If 'Make sure we are dealing with a JPG or GIF file Dim extension As String = Path.GetExtension(UploadClassifieds.PostedFile.FileName).ToLower() Dim MIMEType As String = Nothing Select Case extension Case ".gif" MIMEType = "image/gif" Case ".jpg", ".jpeg", ".jpe" MIMEType = "image/jpeg" Case ".png" MIMEType = "image/png" Case Else 'Invalid file type uploaded e.Cancel = True Exit Sub End Select 'Specify the values for the MIMEType and Ima

      L Offline
      L Offline
      leckey 0
      wrote on last edited by
      #2

      You have a history of giving meaningless titles to your questions. Please use the code tags. Most of us ignore looking at your question if you can't follow the basic guidelines.

      Back in the blog beatch! http://CraptasticNation.blogspot.com/[^]

      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