I was looking for a way that how can I fetch all the categories from Tridion using Categoriesdata. I was trying like below, but its showing error.
CoreServiceSession client = new CoreServiceSession();
SessionAwareCoreServiceClient csClient = client.GetClient();
ReadOptions readoption = new ReadOptions();
CategoriesFilterData filter = new CategoriesFilterData();
XElement xml = csClient.GetSystemWideList(filter);
You need to use GetListXml instead of GetSystemWideList and specify the publication ID from which you want to retrieve the categories:
GetSystemWideList is usually for retrieving stuff that is system wide and not bound to just 1 publication, like PublicationTargets and MultimediaTypes
You could however also try a Search query, like so: