SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 490 | Next

Scott Klein

"Professional LINQ"

When completed, the ProductMain
form should look something like Figure A-6.
Before this form can be used a few changes need to be made. Open the form in design mode and doubleclick
any gray area to view the code behind the form and to create the Load() event for this form. Next,
add the following line of code directly above the ProductMain form constructor:
private int _productID;
A new constructor needs to be added so that a ProductID can be passed in, so add the following code
below the default ProductMain constructor.
public ProductMain(int productID)
{
InitializeComponent();
_productID = productID;
}
Then, enter the following code in the ProductMain form??™s Load() event. It populates the form??™s two
lookup combos.
323
Appendix A: Case Study
Figure A-6
FabrikamDataContext context =
new FabrikamDataContext("user id=username;password=password");
//first, the producttypes
IEnumerable result =
from prod in context.ProductTypes
orderby prod.Name
select prod;
DataTable dt = new DataTable("ProductType");
DataColumn dc;
DataRow dr;
dc = new DataColumn();
dc.


Pages:
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6