Failed to connet SqlClient - InfoPath Dev
in

InfoPath Dev

Failed to connet SqlClient

Last post 08-11-2006 09:14 AM by Greg Collins. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-09-2006 02:31 AM

    • angie
    • Not Ranked
    • Joined on 08-09-2006
    • Malaysia
    • Posts 4

    Failed to connet SqlClient

    I'm using InfoPath 2007. I try to retrieve the records from SQL server and update the form's field but system prompt the following error when execute the code "MyConnection.Open();"

    System.Security.SecurityException
    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 StaffAbsenceRequestForm.FormCode.CTRL39_5_Clicked(Object sender, ClickedEventArgs e)
    at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
    at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

    Please advice and suggest the solution.

    Thank you.

    Regards,
    -angie-
  • 08-09-2006 10:49 AM In reply to

    Re: Failed to connet SqlClient

    Your error indicates that this is a security issue.

    1. Check your permissions.
    2. Try creating a full trust form.
  • 08-11-2006 02:40 AM In reply to

    • angie
    • Not Ranked
    • Joined on 08-09-2006
    • Malaysia
    • Posts 4

    Re: Failed to connet SqlClient

    Thankx Greg Collins. After set to Full Trust Form and the error no occur anymore.
  • 08-11-2006 09:14 AM In reply to

    Re: Failed to connet SqlClient

    Great! Glad to have been able to help!
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.