473,670 Members | 2,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Namespace Not Found?

I successfully compiled a "Database.v b" file (existing in
C:\Inetpub\wwwr oot\ASPX\Busine ss) into "Database.d ll" (in
C:\Inetpub\wwwr oot\ASPX\bin). The namespace in "Database.v b" is
"Database" which encapsulates a class named "DBSettings ". This is the
code in "Database.v b":

Imports System
Imports System.Data
Imports System.Data.Sql Client

Namespace Database
Public Class DBSettings
Private sqlCmd As SqlCommand
Private sqlConn As SqlConnection
Public ConnectionStrin g As String

Public Function QueryDB(ByVal qry As String) As SqlDataReader
sqlConn = New SqlConnection(C onnectionString )
sqlCmd = New SqlCommand(qry, sqlConn)

sqlConn.Open()
Return sqlCmd.ExecuteR eader

sqlConn.Close()
End Function
End Class
End Namespace

To use the above namespace in a class file named "Users.vb" (which
exists in the same folder as "Database.v b"), I am using the following
code:

Imports Database

Namespace Users
Public Class User
Public Function Login(ByVal UserName As String, ByVal Password
As String) As Integer
Dim iID As Integer
Dim boDBSet As DBSettings
Dim sqlReader As SqlDataReader

boDBSet = New DBSettings
boDBSet.Connect ionString = "Data Source=......."
sqlReader = boDBSet.QueryDB ("SELECT ID FROM tblUsers WHERE
UserName='" & UserName & "' AND Password='" & Password & "'")

Do While (sqlReader.Read )
iID = sqlReader.GetIn t32(0)
Loop

Return iID
End Function
End Class
End Namespace

But when I try to compile the above code into "Users.dll" (in the same
folder where "Database.d ll" exists) from the command prompt, the
following errors gets generated:

Namespace or type specified in the Imports 'Database' doesn't contain
any public member or cannot be found. Make sure the namespace or the
type is defined and contains at least one public member.

Type 'DBSettings' is not defined.

which points to the following 2 lines

Dim boDBSet As DBSettings
boDBSet = New DBSettings

What am I doing wrong here?

Thanks,

Arpan

Sep 4 '06 #1
1 1884
I successfully compiled a "Database.v b" file (existing in
C:\Inetpub\wwwr oot\ASPX\Busine ss) into "Database.d ll" (in
C:\Inetpub\wwwr oot\ASPX\bin). The namespace in "Database.v b" is
"Database" which encapsulates a class named "DBSettings ". This is the
code in "Database.v b":
[snip]
But when I try to compile the above code into "Users.dll" (in the same
folder where "Database.d ll" exists) from the command prompt, the
following errors gets generated:

Namespace or type specified in the Imports 'Database' doesn't contain
any public member or cannot be found. Make sure the namespace or the
type is defined and contains at least one public member.

Type 'DBSettings' is not defined.

which points to the following 2 lines

Dim boDBSet As DBSettings
boDBSet = New DBSettings

What am I doing wrong here?

Thanks,

Arpan
The "Imports" statement ("using" in C#) doesn't "do" anything. It
doesn't provide a link to a dll, it just enables the programmer to
leave out the namespaces.
I think you need to find a switch for that command-line compiler (maybe
\r ?) that enables you to specify dll's to be referenced.

Hans Kesting
Sep 5 '06 #2

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

Similar topics

5
5707
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ================================================================= Error 19: "CORBAManagerMessages.h", line 4 # Unexpected 'std'. using std::string; ^^^
8
1912
by: Marcin Kalicinski | last post by:
Is the code below ill formed (because operator >> is defined in different namespace than class B)? It fails with VS 2005 Beta. I don't know if I should redesign my code or if I should find a better compiler? namespace N1 { class A { }; std::istream &operator >>(std::istream &, A &);
7
7431
by: Kevin Newman | last post by:
I've been toying with a namespace manager, and wanted to get some input. So what do you think? if (typeof com == 'undefined') var com = {}; if (!com.unFocus) com.unFocus = {}; com.unFocus.Namespaces = new function() { this.register = function(namespace) { namespace = namespace.split('.');
7
2098
by: Kai-Uwe Bux | last post by:
Hi folks, I observed something that puzzles me. When I do namespace xxx { using std::swap; } it appears that xxx::swap and std::swap are not strictly equivalent. In particular, I think that my implementation will only choose the partial specialization for std::vector when std::swap is used.
20
3858
by: Patrick Guio | last post by:
Dear all, I have some problem with insertion operator together with namespace. I have a header file foo.h containing declaration of classes, typedefs and insertion operators for the typedefs in a named namespace namespace foo { class Foo
4
1875
by: BH | last post by:
Hi C# & .NET detectives, can you help with two problems I've encountered lately? 1) These seem equivalent to me but one fails and the other doesn't. This fails with "type or namespace 'Security' could not be found" message: //----------- using System; using System.Threading;
2
2045
by: Steve Richter | last post by:
I have a simple project that builds ok in Visual Web Developer, but which fails when I navigate to it at //localhost. The error is "namespace 'ac' could not be found". the problem page is at inetpub/wwwroot/DemoSite/Page1.aspx which I navigate to at //localhost/DemoSite/Page1.aspx
6
3405
by: ryan.d.rembaum | last post by:
Hello, I have code that I wish to use in many web applications. Basically sort of stand utility stuff. So from Visual Studio Project I select add a component and chose Component Class. Lets say I enter code at the end of this question in to the code section. How then would I reference this in a new Web Application (or in the same web application for that matter?)
18
7728
by: jacksu | last post by:
I have a simple program to run xpath with xerces 1_2_7 XPathFactory factory = XPathFactory.newInstance(); XPath xPath = factory.newXPath(); XPathExpression xp = xPath.compile(strXpr); System.out.println(xp.evaluate(new InputSource(new FileInputStream("a.xml"))));
3
2849
by: sjt003 | last post by:
I have been developing web apps in Visual Studio 2003, but since the other developers in my office don't use Visual Studio, I may have to stop too unless there is an efficient way for them to compile the code outside of Visual Studio if they need to adjust something I created. I have been trying to use vbc.exe, but I'm having problems with references to the DataSet I have created. Multiple pages reference my dataset - "DataSet1", ......
0
8384
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8591
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6212
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1791
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.