Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine DataBindings at runtime
Message
De
27/09/2005 17:19:50
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
01051886
Message ID:
01053655
Vues:
14
>Hello all, I have a form whose textboxes can be bound to either of two DataSets, is there a way to determine which DataSet they're bound to at runtime ?
>
>// pseudo code
>
>
>if(this.txtAddr1.DataBinding is MyDataSet1)
>    someaction;
>else
>        someotheraction;
>
>
Pete,

Sorry this is in VB, but this approach should work. There may be a simpler way so I will be looking for other replies
Dim db As Binding = Me.txtAddr1.DataBindings.Item("TEXT")
   Dim dv As DataView = dv.DataSource
   Dim ds As DataSet = dv.Table.DataSet()

   If ds Is MyDataSet1 Then

   Else

   End If
Terry Carroll
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform