I'm trying this;
public partial class StoredProcedures
{
[Microsoft.SqlServer.Server.SqlProcedure]
public static void ExportXML_v1_2(string file_path, string file_name, string xml_data, out int status, out string error_messages)
{
string Folder1 = file_path;
string xml = xml_data;
error_messages = "";
status = 0;
try
{
if (!Directory.Exists(Folder1))
{
Directory.CreateDirectory(Folder1);
}
I get this error;
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) at StoredProcedures.ExportXML_v1_2(String file_path, String file_name, String xml_data, Int32& status, String& error_messages)
The action that failed was: Demand The type of the first permission
that failed was: System.Security.Permissions.FileIOPermission
The Zone of the assembly that failed was: MyComputer