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. Edit the data in a detail view at run time [modified]

Edit the data in a detail view at run time [modified]

Scheduled Pinned Locked Moved ASP.NET
questiondatabasewpfwcfdesign
3 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

    modified on Friday, July 4, 2008 4:16 AM

    S 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

      modified on Friday, July 4, 2008 4:16 AM

      S Offline
      S Offline
      Sherin Iranimose
      wrote on last edited by
      #2

      Hi Have a look at this Details View[^]

      EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

      R 1 Reply Last reply
      0
      • S Sherin Iranimose

        Hi Have a look at this Details View[^]

        EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.

        R Offline
        R Offline
        Rock Star
        wrote on last edited by
        #3

        Hi, I am planning to use dbprovider factory class and retrieving and binding the detailsview with the dataset at runtime. And now I want to edit the data in it. I am not using a data source. So how can I edit the data in a detail view now. So what code or property should I add in a detailsview to update the data in a detailsview.

        Rock Star

        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