Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

SQL create directories

kvnsdrkvnsdr Posts: 9Member
I have a list of names in my SQL database("Books"), datatable("BookName") that I would like to use to create directories on my computer. The following code work excellent using a .txt file of the book names, however the SQL database has the same identical list of names. I'd like to use the SQL instead of the .txt file approach... Help...........


string strSource = (@"C:ookName.txt");
DirectoryInfo source = new DirectoryInfo(strSource);
string strTarget = (@"C:ooks");
DirectoryInfo target = new DirectoryInfo(strTarget);

StreamReader sr = File.OpenText(strSource);
string read;
while ((read = sr.ReadLine()) != null)
{
target.CreateSubdirectory(read);
}
sr.Close();

keivn@upgrade1.com

Comments

  • kvnsdrkvnsdr Posts: 9Member
    : I have a list of names in my SQL database("Books"), datatable("BookName") that I would like to use to create directories on my computer. The following code work excellent using a .txt file of the book names, however the SQL database has the same identical list of names. I'd like to use the SQL instead of the .txt file approach... Help...........
    :
    :
    : string strSource = (@"C:ookName.txt");
    : DirectoryInfo source = new DirectoryInfo(strSource);
    : string strTarget = (@"C:ooks");
    : DirectoryInfo target = new DirectoryInfo(strTarget);
    :
    : StreamReader sr = File.OpenText(strSource);
    : string read;
    : while ((read = sr.ReadLine()) != null)
    : {
    : target.CreateSubdirectory(read);
    : }
    : sr.Close();
    :
    :
    :

Sign In or Register to comment.