SqlCommand cmd = new SqlCommand("SELECT Name, Age, Address FROM Customers", con); SqlDataReader reader = cmd.ExecuteReader(); while(reader.Read()) { string name = RowParser.ReadColumn(reader, "Name"); int age = RowParser.ReadColumn (reader, "Age"); string address = RowParser.ReadColumn (reader, "Address"); // Do something with the data }
DataSet ds = new DataSet(); ds.ReadXml("Customers.xml"); foreach(DataRow row in ds.Tables[0].Rows) { string name = RowParser.ReadColumnThese examples demonstrate how the RowParser.ReadColumn method can be used to extract data from a database query or a dataset. The RowParser class is part of the PetaPoco package library, a lightweight ORM (object-relational mapping) for .NET.(row, "Name"); int age = RowParser.ReadColumn (row, "Age"); string address = RowParser.ReadColumn (row, "Address"); // Do something with the data }