I tried to get file path using below code.
string script = File.ReadAllText(Application.StartupPath + "D:\\Tax Rouding Projects\\10-12-12 TaxRoundingUtility\\TaxRoundingUtility\\Scripts\\GP_SOP_AdjustTax.sql");
But i am getting error : The given path’s format is not supported
if i try to open the file from windows explorer.. i am able to go file location..
D:\Tax Rouding Projects\10-12-12 TaxRoundingUtility\TaxRoundingUtility\Scripts\
But why i cannot using c# code…
Any thing i missed in the path…
The problem lies here
This might end up giving you something like
which is an invalid path. Append only portion of path that you need like (the second part is just an example)
Also make sure to escape the ‘\’ in your file path strings.
Edit: As Dante has mentioned in the comment in the question, If your target path is fixed and known, you do not need the Application.StartppPath. Just load/read the file for which you have the complete path.