Skip to content

Example Pass_002

蔡家滄 edited this page May 23, 2017 · 1 revision

Example Pass_002

SqlCommand cmd = new SqlCommand("select * from Categories", Connection);
var category = new { CategoryID = 0, CategoryName = "" };
using (var dr = cmd.ExecuteReader())
{
   if (dr.Read())
   {
      dr.QueryFill(category);
      Debug.Print($"{category}");
   }
   else
      Debug.Print("No Data Found");
}
{ CategoryID = 1, CategoryName = Beverages }
Clone this wiki locally