Perry Whittle (4/13/2009)
I apologize, but unfortunately, because of conflicts between VS 2005/.net 2.0 and VS 2008/.net 3.5, my SMO dev environment is down right now so I cannot effectively test anything.
I have never used EnumDirectories (though I intend to real soon) however from BOL I get this:
Public Function EnumDirectories ( _
path As String _
) As DataTable
So I would assume the something like this ought to work:
dTable = srv.EnumDirectories("C:\")
Does that not work for you?
do you not have to provide a depth level too though, i see the output from xp_dirtree. How does that relate to EnumDirectories
I don't think that you have that option, SMO just sticks a 1 in for you.
If there is something in SMO that exposes "xp_dirtree" fully, I haven't found it yet.
Of course, you can just EXEC xp_dirtree yourself, you know. 🙂