Home Forums WPF controls Xceed DataGrid for WPF any1 know what this exception’s reason ?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #25143 |

    Hi everybody

    i met this exception in trying to binding datagrid from the database:

    Request for the permission of type ‘System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed.
    at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
    at System.Security.PermissionSet.Demand()
    at System.Data.Common.DbConnectionOptions.DemandPermission()
    at System.Data.SqlClient.SqlConnection.PermissionDemand()
    at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.SqlClient.SqlConnection.Open()
    at XBAPLastGrid.Page1..ctor()
    The action that failed was:
    Demand
    The type of the first permission that failed was:
    System.Data.SqlClient.SqlClientPermission
    The Zone of the assembly that failed was:
    MyComputer

    any1 know what is the reason ?

    thanks for advance

    Imported from legacy forums. Posted by NAHR_ELGANNAH (had 537 views)

    User (Old forums)
    Member
    Post count: 23064

    Check out <a href=”http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1084759&SiteID=1″>here</a&gt;

    Imported from legacy forums. Posted by nat (had 310 views)

    User (Old forums)
    Member
    Post count: 23064

    Thank you testn
    but i don’t use a database located in a different server.

    FYI, i tried the same code with windows application and it worked properly. but with using XAML Browser Application i met this strange problem.

    any advices ?

    Imported from legacy forums. Posted by NAHR_ELGANNAH (had 379 views)

    User (Old forums)
    Member
    Post count: 23064

    Sandbox means you can’t even use database located on the same server.
    <a href=”http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2286461&SiteID=1″>http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2286461&SiteID=1</a&gt; Web services is probably a better alternative.

    Imported from legacy forums. Posted by nat (had 212 views)

    User (Old forums)
    Member
    Post count: 23064

    Thank you testn again

    i tried to follow your advice and made a trivial web service and tried to call it from XBAP but i recieved this error:

    “Cannot create instance of ‘Page1’ defined in assembly ‘XBAPLastGrid, Version=1.0.2852.26076, Culture=neutral, PublicKeyToken=null’. Exception has been thrown by the target of an invocation. Error in markup file ‘Page1.xaml’ Line 1 Position 7”

    this is although when trying the same calling in a web site (not XAML) it worked properly.

    Imported from legacy forums. Posted by NAHR_ELGANNAH (had 4235 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.