public Products_Category[] GetAllCategories() { var detials = new List <Products_Category>(); TableData.Clear(); TableData = objadminDb.GetAllCategories(); detials.AddRange(from DataRow dt in TableData.Rows select new Products_Category { pcName = dt["pcName"].ToString(), prod_cat_id = Convert.ToInt32(dt["prod_cat_id"].ToString()), }); return(detials.ToArray()); }