Mursaleen Hassan

Mursaleen Hassan

  • NA
  • 22
  • 3.9k

How to add Dataset Rows stored into class variable through L

Dec 23 2018 11:14 AM
How to Dataset Rows stored into scoop_Info class variables because i have a Crystal Report and i wants CR parameter get scoop_Info class variables data. Thanks
  1. scoop_Token_Report crystal_Report = new scoop_Token_Report();  
  2. List _List = new List();  
  3. string query = "SELECT `name`, `quantity` FROM `tbl_scoop_customer` WHERE `odr_id` = 5";  
  4. DataSet ds = method_Class.method_Class.dataSet_Record(query);  
  5. foreach (DataRow dr in ds.Tables[0].Rows)  
  6. {  
  7.     _List.Add(new scoop_Info  
  8.     {  
  9.         Quantity = Convert.ToInt16(dr["quantity"].ToString()),  
  10.         Description = dr["name"].ToString(),  
  11.     });  
  12. }  
  1. class scoop_Info  
  2.     {  
  3.         public int Quantity { getset; }  
  4.         public string Description { getset; }  
  5.     }  

Answers (2)