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. General Programming
  3. Visual Basic
  4. Edit the data in a detail view at run time

Edit the data in a detail view at run time

Scheduled Pinned Locked Moved Visual Basic
questiondatabasewpfwcfdesign
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.
  • R Offline
    R Offline
    Rock Star
    wrote on last edited by
    #1

    Hi, I am binding a data in a detail view at run time. But I also want to edit it at the run time. I have tried the following code. Protected Sub Detailsview1_ItemUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdateEventArgs) Handles Detailsview1.ItemUpdating Dim index As Integer = Generic_DG.SelectedIndex Dim con As New SqlConnection(ConfigurationManager.AppSettings("connectionString")) Dim cmd As New SqlCommand() cmd.CommandText = "UPDATE Products SET ProdName=@ProdName where ProdId=@ProdId" cmd.Connection = con cmd.Connection.Open() cmd.ExecuteNonQuery() cmd.Connection.Close() End Sub How can I replace @ProdName with data in a detail view? OR Which property of the detailview I have to use for it?

    Rock Star

    V 1 Reply Last reply
    0
    • R Rock Star

      Hi, I am binding a data in a detail view at run time. But I also want to edit it at the run time. I have tried the following code. Protected Sub Detailsview1_ItemUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdateEventArgs) Handles Detailsview1.ItemUpdating Dim index As Integer = Generic_DG.SelectedIndex Dim con As New SqlConnection(ConfigurationManager.AppSettings("connectionString")) Dim cmd As New SqlCommand() cmd.CommandText = "UPDATE Products SET ProdName=@ProdName where ProdId=@ProdId" cmd.Connection = con cmd.Connection.Open() cmd.ExecuteNonQuery() cmd.Connection.Close() End Sub How can I replace @ProdName with data in a detail view? OR Which property of the detailview I have to use for it?

      Rock Star

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      hi I see what you are trying to do , but your question says something else, now from what i see from your code, you have parameters that are not declared.

      Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

      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