473,320 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Using Business Component

I have a business component I've built in its .vb file. Compiled the .vb
file and copied the outputted dll to the bin directory of my virtual
directory. Now in my aspx page when I attempt to utilize the business
component, I get this:

Compiler Error Message: BC30002: Type 'MyClass' is not defined

Here is the .vb file:
Imports System

Namespace myComponents

Public Class MyClass
Public Sub New()
End Sub

Public Function Authenticate(username As String, password As String) As
Boolean
return True
End Function

End Class
End Namespace

to compile the .vb file I did the following:

vbc /t:library myClass.vb

In my .aspx file:

<%@ Import Namespace="myComponents" %>

Then in some of my logic I go to use the class:

Dim misc As New MyClass

I'm using 2.0 Framework - clearly I'm a newbie (an ASP convert).

Any help you can provide would be much appreciated.

BBB
Feb 3 '06 #1
6 1970
This should have worked in 2.0. But try this. create a folder called
App_Code in your website directory. Then copy your myClass.vb file
there. Delete the compiled dll from the bin folder and see if you page
runs. 2.0 contains this special App_Code folder that compiles any
source file in that special folder.

Like I said, I still think what you did should have worked. The method
i'm suggesting is just an alternative to compiling the source code
yourself.

Feb 3 '06 #2
Same error. I'm on a Windows 2000 box if that matters.

Looks like I have this version of the framework:

v2.0.50727
"tdavisjr" <td******@gmail.com> wrote in message
news:11********************@g43g2000cwa.googlegrou ps.com...
This should have worked in 2.0. But try this. create a folder called
App_Code in your website directory. Then copy your myClass.vb file
there. Delete the compiled dll from the bin folder and see if you page
runs. 2.0 contains this special App_Code folder that compiles any
source file in that special folder.

Like I said, I still think what you did should have worked. The method
i'm suggesting is just an alternative to compiling the source code
yourself.

Feb 3 '06 #3
Did you add the assembly directive in the aspx
to reference that assembly?

"booner" <b3******@yahoo.com> wrote in message
news:2TIEf.529652$084.58394@attbi_s22...
I have a business component I've built in its .vb file. Compiled the .vb
file and copied the outputted dll to the bin directory of my virtual
directory. Now in my aspx page when I attempt to utilize the business
component, I get this:

Compiler Error Message: BC30002: Type 'MyClass' is not defined

Here is the .vb file:
Imports System

Namespace myComponents

Public Class MyClass
Public Sub New()
End Sub

Public Function Authenticate(username As String, password As String) As
Boolean
return True
End Function

End Class
End Namespace

to compile the .vb file I did the following:

vbc /t:library myClass.vb

In my .aspx file:

<%@ Import Namespace="myComponents" %>

Then in some of my logic I go to use the class:

Dim misc As New MyClass

I'm using 2.0 Framework - clearly I'm a newbie (an ASP convert).

Any help you can provide would be much appreciated.

BBB

Feb 3 '06 #4
No, I did not. I was not aware I needed to. What would that look like and
what does it do? Dang newbies :-)

"Raymond" <Ra*@nothere.net> wrote in message
news:HpKEf.16$H43.12@trnddc08...
Did you add the assembly directive in the aspx
to reference that assembly?

"booner" <b3******@yahoo.com> wrote in message
news:2TIEf.529652$084.58394@attbi_s22...
I have a business component I've built in its .vb file. Compiled the ..vb file and copied the outputted dll to the bin directory of my virtual
directory. Now in my aspx page when I attempt to utilize the business
component, I get this:

Compiler Error Message: BC30002: Type 'MyClass' is not defined

Here is the .vb file:
Imports System

Namespace myComponents

Public Class MyClass
Public Sub New()
End Sub

Public Function Authenticate(username As String, password As String) As Boolean
return True
End Function

End Class
End Namespace

to compile the .vb file I did the following:

vbc /t:library myClass.vb

In my .aspx file:

<%@ Import Namespace="myComponents" %>

Then in some of my logic I go to use the class:

Dim misc As New MyClass

I'm using 2.0 Framework - clearly I'm a newbie (an ASP convert).

Any help you can provide would be much appreciated.

BBB


Feb 3 '06 #5
Well, I'm not familiar with 2.0, but from what I know
of 1.0 and 1.1, you need an assembly directive.

http://msdn.microsoft.com/library/de...onassembly.asp

"booner" <b3******@yahoo.com> wrote in message
news:NvKEf.772358$xm3.6532@attbi_s21...
No, I did not. I was not aware I needed to. What would that look like and what does it do? Dang newbies :-)

"Raymond" <Ra*@nothere.net> wrote in message
news:HpKEf.16$H43.12@trnddc08...
Did you add the assembly directive in the aspx
to reference that assembly?

"booner" <b3******@yahoo.com> wrote in message
news:2TIEf.529652$084.58394@attbi_s22...
I have a business component I've built in its .vb file. Compiled the .vb file and copied the outputted dll to the bin directory of my virtual
directory. Now in my aspx page when I attempt to utilize the business
component, I get this:

Compiler Error Message: BC30002: Type 'MyClass' is not defined

Here is the .vb file:
Imports System

Namespace myComponents

Public Class MyClass
Public Sub New()
End Sub

Public Function Authenticate(username As String, password As
String)
As Boolean
return True
End Function

End Class
End Namespace

to compile the .vb file I did the following:

vbc /t:library myClass.vb

In my .aspx file:

<%@ Import Namespace="myComponents" %>

Then in some of my logic I go to use the class:

Dim misc As New MyClass

I'm using 2.0 Framework - clearly I'm a newbie (an ASP convert).

Any help you can provide would be much appreciated.

BBB



Feb 3 '06 #6
Adding this to my aspx file fixed the issue:

<%@ Assembly src="myClass.vb" %>

Now to determine why. The book I'm reading makes no mention of it - and
describes compiling and placing in the bin directory as the way to do this.
"Raymond" <Ra*@nothere.net> wrote in message news:gEKEf.1$xs4.0@trnddc01...
Well, I'm not familiar with 2.0, but from what I know
of 1.0 and 1.1, you need an assembly directive.

http://msdn.microsoft.com/library/de...onassembly.asp
"booner" <b3******@yahoo.com> wrote in message
news:NvKEf.772358$xm3.6532@attbi_s21...
No, I did not. I was not aware I needed to. What would that look like

and
what does it do? Dang newbies :-)

"Raymond" <Ra*@nothere.net> wrote in message
news:HpKEf.16$H43.12@trnddc08...
Did you add the assembly directive in the aspx
to reference that assembly?

"booner" <b3******@yahoo.com> wrote in message
news:2TIEf.529652$084.58394@attbi_s22...
> I have a business component I've built in its .vb file. Compiled the
.vb
> file and copied the outputted dll to the bin directory of my virtual
> directory. Now in my aspx page when I attempt to utilize the

business > component, I get this:
>
> Compiler Error Message: BC30002: Type 'MyClass' is not defined
>
> Here is the .vb file:
> Imports System
>
> Namespace myComponents
>
> Public Class MyClass
> Public Sub New()
> End Sub
>
> Public Function Authenticate(username As String, password As

String)
As
> Boolean
> return True
> End Function
>
> End Class
> End Namespace
>
> to compile the .vb file I did the following:
>
> vbc /t:library myClass.vb
>
> In my .aspx file:
>
> <%@ Import Namespace="myComponents" %>
>
> Then in some of my logic I go to use the class:
>
> Dim misc As New MyClass
>
> I'm using 2.0 Framework - clearly I'm a newbie (an ASP convert).
>
> Any help you can provide would be much appreciated.
>
> BBB
>
>



Feb 3 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Fred | last post by:
Not much expertise on XSLT and trying to understand it's uses when creating apps in VS.NET? If I wanted flexibility on the UI (View aspect of M.V.C.): - How does it compare with creating...
25
by: Stuart Hilditch | last post by:
Hi all, I am hoping that someone with some experience developing nTier apps can give me some advice here. I am writing an nTier web app that began with a Data Access Layer (DAL), Business...
0
by: MicroMoth | last post by:
hi, I'm new to ASP.Net and I'm trying to separate my application into a design layer, a business layer (which I am using my code behind pages for) and a data access layer. I was told that I'd...
0
by: Vendell | last post by:
Join one of Canada's finest business men... Dear entrepreneur colleague: Here is a message from the founder.... Let me introduce myself. My name is Ariel Topf. I am 42 years old and I have...
0
by: Rajesh | last post by:
Hi, I have a vc++ com component all the business validations are done through the component.Im using interop to communicate with the com component through ..Net(C#) I want to design a class...
4
by: Code Monkey | last post by:
I want to use Pay Pal in my web site. What I want to do is attach the following code to a button <code> ASCIIEncoding encoding = new ASCIIEncoding(); string postData = "cmd=" + "business";...
34
by: Nate Baxley | last post by:
I'm working to convince my office to make the switch to PHP from ASP. I've convinced them that some change needs to be made, but I think there is some hesitation about PHP being too non-corporate. ...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
2
by: grawsha2000 | last post by:
Greetings, I am developing this N-tier business app. The problem I'm facing is when I try to pass business objects (employees, dept..etc) from business tier to data tier,i.e., the add method in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.