Author Message

I try to load a dll from a webserver and show the form. That works fine but when i try to load som data from a SQL database i get an exception.

How i load the form(works fine)
    Private Sub LoadForm()
        Dim frmAsm As Reflection.Assembly

        frmAsm = Reflection.Assembly.LoadFrom("http://localhost/windowsapplication1.dll")

        Dim frmType As Type = frmAsm.GetType("WindowsApplication1.Form1")

        Dim FrmObj As Object
        FrmObj = Activator.CreateInstance(frmType)

        Dim Frm1 As Form = CType(FrmObj, Form)

    End Sub

When the form is loaded i try to read data
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub

and get the following error

An unhandled exception of type 'System.Security.SecurityException' occurred in
Additional information: Request for the permission of type System.Data.SqlClient.SqlClientPermission, System.Data, Version=1.0.2411.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

Can anyone help me to solve this issue ?

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!

Fri, 02 Apr 2004 17:43:55 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Reflection assembly version recognition...

2. Reflection.Assembly.LoadFrom

3. Trying to Dunamically Load Assembly via Reflection

4. Missing assembly when using reflection to call component method

5. Assembly and Global Assembly Cache

6. reating a dynamic assembly for Form and display Form created through Reflection.Emit Class and AssemblyBuilder Class

7. Reflection and Property Type Comparison

8. Getting the object name via reflection

9. Release a reference from System.Reflection

10. Reflection

11. How far can System.Reflection take you?

12. reflection of a private property WITH parameters?


Powered by phpBB® Forum Software