473,385 Members | 1,409 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,385 software developers and data experts.

Business Objects?

This is how I am creating a simple business object:

'This code exists in a class file named MyDatabase.vb
Imports System
Imports System.Data
Imports System.Data.SqlClient

Namespace ASPNETDB
Public Class MyDatabase
End Class
End Namespace

The above VB file exists in the the folder
C:\Inetpub\wwwroot\ASPX\Business.

This is the command I am using in a command prompt window to compile
the above VB file into a DLL file named ASPNETDB.dll (after compiling,
the DLL will be created in the folder C:\Inetpub\wwwroot\ASPX\bin):

C:\Inetpub\wwwroot\ASPX\bin>C:\WINNT\Microsoft.NET \Framework\v2.0.50727\vbc.exe
/t:library /out:ASPNETDB.dll /r:System.dll /r:System.Data.dll
...\Business\MyDatabase.vb

The above command successfully creates ASPNETDB.dll in the
C:\Inetpub\wwwroot\ASPX\bin\ folder but when I try to access this
business object in an ASPX page using the following simple code:

<%@ Import Namespace="ASPNETDB" %>
<script runat="server">
Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)
Dim boDatabase As New MyDatabase
lblMessage.Text = "Object Created"
End Sub
</script>

<form runat="server">
<asp:Label ID="lblMessage" runat="server"/>
</form>

ASP.NET generates the following error:

Type 'MyDatabase' is not defined.

pointing to the Dim boDatabase As New MyDatabase line.

Can someone please point out where am I going wrong?

Thanks,

Arpan

Sep 1 '06 #1
2 1337
hi Arpan,
it sounds like the ASPX folder is not an 'application' in IIS. if you go
into the IIS manager and right-click the ASPX folder, open Properties, if
the Application Name box is greyed out, click the 'Create' button and this
should solve your problem. if this is the case then your bin folder isn't
in the 'root' of an application so it is ignored by the framework.

hope this helps
tim

"Arpan" <ar******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
This is how I am creating a simple business object:

'This code exists in a class file named MyDatabase.vb
Imports System
Imports System.Data
Imports System.Data.SqlClient

Namespace ASPNETDB
Public Class MyDatabase
End Class
End Namespace

The above VB file exists in the the folder
C:\Inetpub\wwwroot\ASPX\Business.

This is the command I am using in a command prompt window to compile
the above VB file into a DLL file named ASPNETDB.dll (after compiling,
the DLL will be created in the folder C:\Inetpub\wwwroot\ASPX\bin):

C:\Inetpub\wwwroot\ASPX\bin>C:\WINNT\Microsoft.NET \Framework\v2.0.50727\vbc.exe
/t:library /out:ASPNETDB.dll /r:System.dll /r:System.Data.dll
..\Business\MyDatabase.vb

The above command successfully creates ASPNETDB.dll in the
C:\Inetpub\wwwroot\ASPX\bin\ folder but when I try to access this
business object in an ASPX page using the following simple code:

<%@ Import Namespace="ASPNETDB" %>
<script runat="server">
Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)
Dim boDatabase As New MyDatabase
lblMessage.Text = "Object Created"
End Sub
</script>

<form runat="server">
<asp:Label ID="lblMessage" runat="server"/>
</form>

ASP.NET generates the following error:

Type 'MyDatabase' is not defined.

pointing to the Dim boDatabase As New MyDatabase line.

Can someone please point out where am I going wrong?

Thanks,

Arpan

Sep 1 '06 #2
Thanks a million times, Tim. You have hit the nail on the head. The
"ASPX" folder wasn't an application. So after setting it as an
application in the IIS, it's working now.

Regards,

Arpan
Tim_Mac wrote:
hi Arpan,
it sounds like the ASPX folder is not an 'application' in IIS. if you go
into the IIS manager and right-click the ASPX folder, open Properties, if
the Application Name box is greyed out, click the 'Create' button and this
should solve your problem. if this is the case then your bin folder isn't
in the 'root' of an application so it is ignored by the framework.

hope this helps
tim

"Arpan" <ar******@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
This is how I am creating a simple business object:

'This code exists in a class file named MyDatabase.vb
Imports System
Imports System.Data
Imports System.Data.SqlClient

Namespace ASPNETDB
Public Class MyDatabase
End Class
End Namespace

The above VB file exists in the the folder
C:\Inetpub\wwwroot\ASPX\Business.

This is the command I am using in a command prompt window to compile
the above VB file into a DLL file named ASPNETDB.dll (after compiling,
the DLL will be created in the folder C:\Inetpub\wwwroot\ASPX\bin):

C:\Inetpub\wwwroot\ASPX\bin>C:\WINNT\Microsoft.NET \Framework\v2.0.50727\vbc.exe
/t:library /out:ASPNETDB.dll /r:System.dll /r:System.Data.dll
..\Business\MyDatabase.vb

The above command successfully creates ASPNETDB.dll in the
C:\Inetpub\wwwroot\ASPX\bin\ folder but when I try to access this
business object in an ASPX page using the following simple code:

<%@ Import Namespace="ASPNETDB" %>
<script runat="server">
Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)
Dim boDatabase As New MyDatabase
lblMessage.Text = "Object Created"
End Sub
</script>

<form runat="server">
<asp:Label ID="lblMessage" runat="server"/>
</form>

ASP.NET generates the following error:

Type 'MyDatabase' is not defined.

pointing to the Dim boDatabase As New MyDatabase line.

Can someone please point out where am I going wrong?

Thanks,

Arpan
Sep 2 '06 #3

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

Similar topics

5
by: Shibu | last post by:
Hi, I have a situation where I need to convert business objects to a flat table. The reverse is also required. I am using c# and Oracle ODP. I am looking for an easier method to do the below...
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...
2
by: headware | last post by:
I am new to 3-tiered design and am in the process of designing an application that will work with ASP.NET as well as Windows Forms (and possibly with a PDA of some sort down the road). My question...
5
by: G. Stewart | last post by:
The word "Business" in the term implies some sort of commercial aspects or connotations. But from what I can see, that is not necesserially the case at all? So what is the reasoning behind the...
8
by: Keith-Earl | last post by:
Okay, looking for a Best Practice. We are building a classic three tier app in VB.NET. When we load up a WebForm we have access to very useful objects such as the Session object. We frequently...
18
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
1
by: Nemisis | last post by:
hi guys, Currently converting an old classic asp system to a OOP asp.net application. We are building the new application using a 3 tier arcitecture and i was wondering about the following. ...
25
by: Penelope Dramas | last post by:
Hello, I'm in a front of very serious .net redesign/rewrite of an old VB6 application. I had been asked to make it .NET 2.0 and would like to ask couple of questions regarding data access as...
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...
2
by: Chris Zopers | last post by:
Hello, I would like to know what's the best way to implement a business logic layer between my user interface and my database. I would say I'd make a dll-project for the business logic layer...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.