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 491 | Next

Scott Klein

"Professional LINQ"

DataType = System.Type.GetType("System.Int32");
dc.ColumnName = "ID";
dt.Columns.Add(dc);
dc = new DataColumn();
dc.DataType = System.Type.GetType("System.String");
324
Appendix A: Case Study
dc.ColumnName = "Name";
dt.Columns.Add(dc);
foreach (ProductType product in result)
{
dr = dt.NewRow();
dr["ID"] = product.ProductTypeID;
dr["Name"] = product.Name;
dt.Rows.Add(dr);
}
cboProductCategory.DataSource = dt;
cboProductCategory.DisplayMember = "Name";
cboProductCategory.ValueMember = "ID";
//now, the manufacturer info...
IEnumerable result1 =
from manu in context.Manufacturers
orderby manu.Name
select manu;
DataTable dt2 = new DataTable("ProductType");
DataColumn dc2;
DataRow dr2;
dc2 = new DataColumn();
dc2.DataType = System.Type.GetType("System.Int32");
dc2.ColumnName = "ID";
dt2.Columns.Add(dc2);
dc2 = new DataColumn();
dc2.DataType = System.Type.GetType("System.String");
dc2.ColumnName = "Name";
dt2.Columns.Add(dc2);
foreach (Manufacturer man in result1)
{
dr2 = dt2.NewRow();
dr2["ID"] = product.


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