Friday, December 03, 2004 - Posts

XML Resource files from SQL 2k

Ever tried to get that xml out of sql for resources ..
 
select 1 as tag ,null as parent,
    id  as [data!1!name],
    value as [data!1!value!element]
from MyTable 
    order by (2)
for xml explicit
 
im not sure if there is any easier way .. ?
with 0 Comments

System.IO.Directory.Copy(...) does not exist

The framework doesnt provide a directory copy method in 1.1,
but there has been some contemplation on this,
http://weblogs.asp.net/bclteam/archive/2004/01/19/60377.aspx
Anyway got this off code project
public static void copyDirectory(string Src,string Dst){
           String[] Files;
 
            if(Dst[Dst.Length-1
]!=Path.DirectorySeparatorChar)
                Dst+=Path.DirectorySeparatorChar;
            if
(!Directory.Exists(Dst)) Directory.CreateDirectory(Dst);
            Files=Directory.GetFileSystemEntries(Src);
            foreach(string Element in
Files){
               
// Sub directories
                if
(Directory.Exists(Element))
                    copyDirectory(Element,Dst+Path.GetFileName(Element));
               
// Files in directory
                else

                    File.Copy(Element,Dst+Path.GetFileName(Element),true
);
                }
            }