Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to display a lookup value in Winform textbox?
Message
From
12/04/2005 15:18:31
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01003915
Message ID:
01003921
Views:
16
Larry,

There's always several ways to do this sort of thing.

If your two DataTables are part of the same DataSet, you can set a relationship between them (I don't use relationships much, and I'm not 100% sure that the Tables have to be part of the same DataSet, but I think so). If you do this, then you'd DataBind your TextBox to the relationship.

Another option (which does not require the tables to be in the same DataSet) is to DataBind your TextBox to a DataView of the Product table, and as you navigate through the OrderDetail table, you change the RowFilter of the Product table's view.

That should get you started but don't be afraid to ask more questions. =)

~~Bonnie



>Hi All,
>
>I'm new to .NET and trying to display a lookup value in a WinForm textbox.
>
>In VFP, I would put something like this in the Refresh() method of a readonly textbox to show the ProductName as I navigated through the OrderDetail table:
>
>IIF(SEEK(OrderDetail.ProductID,'Product','ProductID'),Product.ProductName,'')
>
>
>An alternative in VFP is to SET RELATION between the OrderDetail and Product tables and bind the textbox to the Product.ProductName.
>
>How is this best done in .NET?
>
>TIA,
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform