>MyDS ds = new MyDS(); // my custom class >... >foreach (MyDS.OrdersRow row in ds.Orders.Rows) { > row.CustomerID = cusID; > row.OrderState = 1; // 1=Pending > } >>with this one (generic DataSet)
>DataSet ds = new DataSet(); >... >foreach (DataRow row in ds.Tables["Orders"].Rows) { > row["CustomerId"] = cusID; // undetected error here! field name >is "CustomerID" > row["OrderType"] = "Pending"; // wrong type > } >>Not only the first option is easier to type (intellisense avoids the need to remember each table/column name) but it's also safer: the compiler will check the existence and type of each member.