In sitecore i want to get all child and grand child which inherited form "Industrial Product template .
Below are the fast query , but its giving error Error : End of string expected at position 5.
Fast query:
_masterdb.SelectItems("query:/sitecore/content/Product Catalog/Industrial/Products/*[@@templatename='Industrial Product']")
This is not fast query, you are using normal query . Please use something like :
Sitecore.Data.Items.Item[] items =
database.SelectItems("fast:/sitecore/content/Product Catalog/Industrial/Products//*[@@templateid='yourTemplateId']");
Also please use @@templateid not @@templatename, I made some tests and it's faster using @@templateid.
Also have a look here about using FastQuery.