Tuesday, January 28, 2014
Lesson 24. 2609, 2124, 20483 18/18
1. Dataset, datatable ...
example:
==================================================================
//schema
DataSet ds = new DataSet();
DataTable dt = new DataTable("Products");
DataColumn dc = new DataColumn("id", System.Type.GetType("System.Int32"));
dt.Columns.Add(dc);
dc = new DataColumn("ProductName", System.Type.GetType("System.String"));
dt.Columns.Add(dc);
dt.Columns.Add(new DataColumn("Price", System.Type.GetType("System.Double")));
dt.Columns.Add("CategId", System.Type.GetType("System.Int32"));
ds.Tables.Add(dt);
DataTable dt1 = new DataTable("Categs");
dt1.Columns.AddRange(new DataColumn[]
{
new DataColumn("id", System.Type.GetType("System.Int32")),
new DataColumn("Title", System.Type.GetType("System.String"))
});
ds.Tables.Add(dt1);
//data
string delimrow = "3,meat";
object[] row = delimrow.Split(',');
ds.Tables["Categs"].Rows.Add(2, "footware");
ds.Tables["Categs"].Rows.Add(1,"comp");
ds.Tables["Categs"].Rows.Add(row);
foreach (DataRow dr in ds.Tables["Categs"].Rows)
{
if ((int)dr["id"] > 1)
{
}
}
//where
DataRow[] result = ds.Tables["Categs"].Select("id > 1 and id < 3");//and, or ()
DataColumn dc_parent = ds.Tables["Categs"].Columns["id"];
DataColumn dc_child = ds.Tables["Products"].Columns["CategId"];
DataRelation rel = new DataRelation("lnk_cat_prod", dc_parent, dc_child);
==================================================================
2. CJI project:
- read files CJI
- store data into object model (xmldocument, custom model, datadables)
- search positions and save as HTML
3. Serialization, deserialization (module 6, l.2, 3)
Tuesday, January 21, 2014
Lesson 23. 2609, 2124, 20483 17/18
0. Module 6: Manipulating Cached XML.
1. CJI, part 1.
//1. System.Data. DataSet, DataTable.
//2. Serialization.
Lesson 22. 2609, 2124, 20483 16/18
1. Code Review: Soalar System.
2. System.Xml. XmlDocument.
Tuesday, January 14, 2014
Lesson 21. 2609, 2124, 20483 15/18
1. Code review: CJI.
2. IComparer, ICompare !!!
Subscribe to:
Posts (Atom)