Conversion from string to type integer is not valid
Hello,
I'm trying to delete a File Share file but getting the error in the Subject above and I don't know what's causing it - I'm hoping someone can help.
This is my code:
Dim fileName As String = "MyFile.csv"
Dim folderPath As String = BRApi.FileSystem.GetFileShareFolder(si, FileShareFolderTypes.ApplicationRoot, api) + "\" + si.AppName + "\Groups\MyFolder
BRApi.FileSystem.DeleteFile(si, folderPath, fileName)
When this runs, this is the error: "Conversion from string "\\sgc000462adev2.file.core.windo" to type 'Integer' is not valid."
Why is it trying to convert the folderPath to Int? How do I fix this?
Thanks in advance for your help!
I think you might be using DeleteFile wrong.
I don't think it is expecting a string path in the 2nd parameter, it is expecting a FileSystemLocationType, e.g., FileSystemLocation.FileShare or FileSystemLocation.ApplicationDatabase. If there was a path I believe it would go into the fileFullName parameter.