Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#16 using MysqlConnection and compiling at runtime

open
nobody
None
5
2004-02-24
2004-02-24
Anonymous
No

email : muzamil.waheed@ascertia.com

hi,

I have a really strange situation . Im working on a
solution where im creating a Class on runtime using
Compiler options. the Class has the referrence to ByteFX
mysqlclient, and i am able to sucessfully add the
referrence of bytefx.dll to the newly compiled assembly.

The problem arises when i try to use the
MysqlConnection with byref prefix, the runtime compiler
gives an error with the following description

the error description is :

System.Exception: Compilation Errors :
d:\inetpub\wwwroot\costcentres\binaries\megatron.vb
(22,0) : error BC30007: Reference required to
assembly 'System' containing the base
class 'System.ComponentModel.Component'. Add one to
your project

though i have confirmed with the ilasm.exe that the
newly compiled DLL has correct referrence to the
ByteFX library.
Here it is important to mention that i have included few
other libraries as well which doesnt have any problems.
All the Dll assemblies are in the same folder.

only if i change the type of BYREF oconnection to objct
or any other type. the compilation is successful

Following is the code in the file which is to be compiled
at runtime...

Imports System
Imports Microsoft.VisualBasic
Imports CostCentreEngine
Imports ByteFX
Imports ByteFX.Data
Imports ByteFX.Data.MySqlClient

Namespace UserCostCentres
Public Class megatron

Public Shared Function returnCost(ByRef
oConnection As
ByteFX.Data.MySqlClient.MySqlConnection,Optional
sEstimateID as string="1",Optional ExecutionMode as
integer=1) As engine.modal.CostCentreCostResult
'user code goes here

end function

end class

end namespace

i hope you can help me in this regard as it is trivial for
me to use the referrrenced connection object which is
the already open connection object.

waiting for reply,
regards
Muzzammil
and thanks in advance..

Discussion

  • Reggie Burnett
    Reggie Burnett
    2004-03-17

    Logged In: YES
    user_id=523261

    Did you get it working? I am not sure what is going wrong
    here. Please write back and let us know how you got it
    working.

    Thanks
    -reggie