Well, not quite. It still doesn't work. I debug the steps and the string
var strATSPath = @"\\\\support\\VMS\\VMSDB" but the Directory.Getfiles
responded with directory not found. Does it just not like the Server name
instead of C drive? or is it the 4 back slashes"\\\\"?
Thanks.
try
{
scGetPath = new SqlCommand("select LogFilePath from Admin", conDB);
strATSPath = scGetPath.ExecuteScalar().ToString();
strATSPath = strATSPath.Replace(@"\", @"\\");
}
catch(Exception ex)
{
MessageBox.Show("Error getting the ATS file path : " + ex.ToString()+
"Please contact your support person.", "VMS - ATS file path error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
//Get the latest ATS Access DB file name
try
{//@"C:\\VMS\\VMSDB"
string[] ATSFiles = Directory.GetFiles(strATSPath, "Ats*Db.mdb");
Array.Sort(ATSFiles);
NewATS= ATSFiles[ATSFiles.Length - 1];
}
"Mythran" wrote:
"Alpha" <Al***@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com... Thank you for the reyply. I know the proper format that C# expects. My
question is: Is there a function call or somehting that can covert the
path
data I retrieve from the SQL database (stored there by FolderBrowserDlg)
to
the proper format.
Thanks.
"carion1" wrote:
@"\\Support\VMS\VMSDB";
or
"\\\\Support\\VMS\\VMSDB";
--
Yeah, store it in a string var and use String.Replace :)
string path = GetPathFromDb(); // Returns "\\Support\VMS\VMSDB"
path = path.Replace(@"\", @"\\");
And there ya have it :)
Mythran