How can i remove the .sql extension from my script files?? I want to
read all scripts in directory into a hashtable, and use
Right(scriptFile.FullName, 3) as my key and full name as value:
'buildscript_001.sql
'buildscript_002.sql
'Want to have 001 as key and buildscript_001.sql as value.
Dim scriptDirectory As New IO.DirectoryInfo "C:\Applications
\MyApplicationMainline\SW\App\DatabaseScripts\BuildScripts\")
Dim scriptFileList As IO.FileInfo() =
scriptDirectory.GetFiles()
Dim scriptFile As IO.FileInfo
Dim scriptFileTable As New Hashtable
For Each scriptFile In scriptFileList
'Read scripts to Hash tbl..
scriptFileTable.Add(Right(scriptFile.FullName, 3),
scriptFile.FullName)
Next
Regards
Mcad
Mark Rae [MVP] - 03 Oct 2007 12:02 GMT
> How can i remove the .sql extension from my script files??
http://msdn2.microsoft.com/en-us/library/system.io.path.getfilenamewithoutextens
ion(vs.80).aspx

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
RB - 03 Oct 2007 12:05 GMT
> How can i remove the .sql extension from my script files?? I want to
> read all scripts in directory into a hashtable, and use
[quoted text clipped - 21 lines]
> Regards
> Mcad
Check here:
http://msdn2.microsoft.com/en-us/library/system.io.path_members.aspx
Particularly look at GetFileNameWithoutExtension :-)
gamesforums@hotmail.com - 03 Oct 2007 12:16 GMT
> gamesfor...@hotmail.com wrote:
> > How can i remove the .sql extension from my script files?? I want to
[quoted text clipped - 28 lines]
>
> - Vis sitert tekst -
Thanx, solved it:)!