I can define a macro of the form \csname../dirX Color\endcsname manually and use it as desired. However, I am unable to do the same thing based on the contents as read by the datatool package.
The MWE as below yields:

The desired output of the last line (after uncommenting) is:

Code:
\documentclass{article}
\usepackage{datatool,xstring,xcolor}
\usepackage{filecontents}
\begin{filecontents*}{MyData.csv}
Directory, Color
../dirB, red
../dirC, yellow
\end{filecontents*}
\begin{document}
\textbf{Without datatool:}
\expandafter\gdef\csname../dirA Color\endcsname{blue}%
\xdef\DirAColor{\csname../dirA Color\endcsname}
Color for '../dirA' is '\DirAColor': \textcolor{\DirAColor}{../dirA}.
\bigskip
\textbf{With datatool}
\DTLloadrawdb[keys={Directory,Color}]{MyDB}{MyData.csv}%
\DTLdisplaydb{MyDB}
\medskip
\DTLforeach{MyDB}{\Dir=Directory,\DirColor=Color}{%
\edef\ExpandedDirColor{\DirColor}
\expandafter\gdef\csname\Dir Color\endcsname{\ExpandedDirColor}%
}
\xdef\DirBColor{\csname../dirB Color\endcsname}
Color for '../dirB' is '\DirBColor':% \textcolor{\DirBColor}{../dirB}.
\end{document}
\csname\Dir Color\endcsname. So either use\csname\Dir\space Color\endcsnameor\xdef\DirBColor{\csname../dirBColor\endcsname}. – Stephan Lehmke Jan 8 at 3:49