Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine DataBindings at runtime
Message
From
27/09/2005 17:19:50
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01051886
Message ID:
01053655
Views:
12
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform