Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create New and Delete button on Web page
Message
De
13/02/2012 15:26:56
 
 
À
10/02/2012 16:37:03
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01535128
Message ID:
01535318
Vues:
36
Here is where I am getting stuck.
I can't get the following code to work:
Private Sub btnAddDetail_Click(ByVal sender As System.Object, e As System.EventArgs) Handles btnAddDetail.Click
   ' Retrieve the previous Order Detail DataSet
   Dim dsOrderDetail As DataSet = CType(Session("dsOrderDetail"), DataSet)
   
   ' Add a new row to the DataSet
   Me.oOrderDetail.NewRow(dsOrderDetail, Me.oOrderDetail.TableName, New OrderDetailDefaults(Me.OrderID))
   
   ' Store the DataSet back into the session
   Session("dsOrderDetail") = dsOrderDetail
   
   ' Set the new row for editing
   Me.grdOrderDetail.EditIndex = dsOrderDetail.Tables(Me.oOrderDetail.TableName).Rows.Count - 1
   
   ' Rebind the DataGrid
   Me.BindControl(Me.grdOrderDetail)
End Sub
This line is giving me an error saying I have to have 'new' in it.
Me.grdOrderDetail.EditIndex = dsOrderDetail.Tables(Me.oOrderDetail.TableName).Rows.Count - 1
I don't know what the syntax should be.
Thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform