日期:2014-05-17  浏览次数:20521 次

System.NotSupportedException: 不支持给定路径的格式。
异常详细信息: System.NotSupportedException: 不支持给定路径的格式。

源错误: 


行 24:     public SqlConnection GetCon()
行 25:     {
行 26:         return new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"].ToString());
行 27:     }
行 28:     public int sqlEx(string cmdstr)

源文件: c:\Documents and Settings\Administrator\桌面\WebSite1\App_Code\DB.cs    行: 26 

堆栈跟踪: 


[NotSupportedException: 不支持给定路径的格式。]
   System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath) +9363964
   System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath) +254
   System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) +85
   System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath) +43
   System.IO.Path.GetFullPath(String path) +91
   System.Data.Common.ADP.GetFullPath(String filename) +31
   System.Data.Common.DbConnectionOptions.ExpandDataDirectory(String keyword, String value, String& datadir) +5096268
   System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +3980
   System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
   System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +150
   System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +59
   System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
   System.Data.SqlClient.SqlConnection..ctor(String connectionString) +26
   DB.GetCon() in c:\Documents and Settings\Administrator\桌面\WebSite1\App_Code\DB.cs:26
   DB.reDr(String str) in c:\Documents and Settings\Administrator\桌面\WebSite1\App_Code\DB.cs:57
   Login_Login.Button2_Click(Object sender, EventArgs e) in c:\Documents and Settings\Administrator\桌面\WebSite1\Login\Login.aspx.cs:28
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)