Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where's the code for Dataset ToolStrips?
Message
De
15/09/2007 06:20:07
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Where's the code for Dataset ToolStrips?
Divers
Thread ID:
01254524
Message ID:
01254524
Vues:
72
When one drags a column from a datasource onto a form, VB.NET kindly creates a ToolStrip at the top of the form with useful controls like Next, Previous, Add, Delete and Save. However, it only writes the code for Save to the form, e.g.
Private Sub TableNameBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TableNameBindingNavigatorSaveItem.Click

       Me.Validate()
       Me.TableNameBindingSource.EndEdit()
       Me.TableNameTableAdapter.Update(Me.DataSetName.TableName)

End Sub
I needed to write code to emulate the ToolStrip's behaviour when clicking on the Add symbol, and came up with:
Dim DefaultDate1 As Date
DefaultDate1 = Now
Me.TableNameTableAdapter.Insert("", "", "", "", "", DefaultDate1, "", "")
Me.TableNameBindingSource.AddNew()
Is that correct? If not, how can I see the code used by each of the items in the ToolStrip container? I've tried the Edit Items option, but I couldn't find it there.

Finally, does the Delete method of a table adapter really require ALL the columns as parameters?

Thanks,
David.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform