Edit the data in a detail view at run time [modified]
-
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
-
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
Hi Have a look at this Details View[^]
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
-
Hi Have a look at this Details View[^]
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
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