473,938 Members | 8,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CS0246 (problem with user-defined namespace), C#.NET 2.0

I am new to C#, and created a simple Windows application in C#, just
to test the logic needed. This was a simple log-in which contained a single
namespace. Namespace included a class (in its own .cs file) containing
regular expressions to validate the format of the entries (user id and
password). The reason I put the reg. expressions code in a separate class
was this was a "dry run" for functionality needed for a more complex web
project.
I imported this regular-expressions class into my web application,
and am now trying to call its methods from the code-behind of my login form
(Default.aspx.c s). However, I get this error, even though I put the Using
...... directive for that class' file. I've been going around in circles
trying to find out the right way to use user-defined namespaces in a C#.NET
(2.0) project. Please advise, thanks in advance.
Jun 27 '08 #1
1 1776
Calico Tude <Ca********@dis cussions.micros oft.comwrote:
I am new to C#, and created a simple Windows application in C#, just
to test the logic needed. This was a simple log-in which contained a single
namespace. Namespace included a class (in its own .cs file) containing
regular expressions to validate the format of the entries (user id and
password). The reason I put the reg. expressions code in a separate class
was this was a "dry run" for functionality needed for a more complex web
project.
I imported this regular-expressions class into my web application,
and am now trying to call its methods from the code-behind of my login form
(Default.aspx.c s). However, I get this error, even though I put the Using
..... directive for that class' file. I've been going around in circles
trying to find out the right way to use user-defined namespaces in a C#.NET
(2.0) project. Please advise, thanks in advance.
Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Jun 27 '08 #2

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

Similar topics

1
1429
by: Howard | last post by:
Hi, I am using a very simple xslt file to get info from an xml document. The problem seems to me to be that the xml doc uses a namespace, and I don't know how to set up my xslt to recognize it correctly. If I remove the namespace specification from the xml, I can query the node I want perfectly. But with that namespace in there, it fails. Can someone help? Here's a simpilified version of the xml document, with that namespace stuff:
6
2202
by: Fredrik Nelson | last post by:
Hi, I have used xsl to transform xml from sqlserver in and it works fine now i have a webservice that uses a dataset to get the data and return it as xml like the code below <WebMethod()> _ Public Function ReturnEarnedValues() As XmlDocument Dim MyStream As New IO.StringWriter Dim XD As New XmlDocument
2
1672
by: MAF | last post by:
I am triing to query the following xml document. I am loading the xml into a XML Document and then using XPath to get the EntityDataSet Node Here is my code XMLDoc = new System.Xml.XmlDocument(); if (this.m_FileLocation != null && this.m_FileLocation.Length > 0) XMLDoc.Load(this.m_FileLocation);
4
5264
by: SnakeS | last post by:
When I do: using ROOT.CIMV2.Win32; the class there isn't. This namespace or class I didn't find it. How i using this classes?
5
1698
by: Xarky | last post by:
Hi, I have the following in the project, with the following desgin. // class 1, which is a windows form namespace Name { public class aaaa {
0
785
by: Apollo0130 via DotNetMonster.com | last post by:
hi @ all... i have created two user controls (header.ascx and footer.ascx) with the code-behind pages. it looks like this: Control 1: --------------------------- Namespace Test Public Class header Public Function Make(ByVal Text As String) As String
3
1693
by: Massimo Gentilini | last post by:
I have a problem with namespace: I've a class in a namespace namespace.Foo that's used in a web method when I reference the web method from a web service the namespace changes because of the wsdl compiler, so now my class, in the code using the web
0
1117
by: Adi | last post by:
hi everyone.. i am working on a web application in VS 2005.. i recently converted my application from VS2003 to VS2005.. after the conversion.. when i compiled the application i was starting to get this error in one of the pages.. banner.ascx.cs The type or namespace name 'SampleLogin' could not be found (are you missing a using directive or an assembly reference?) both files banner.ascx.cs and SampleLogin.aspx.cs are under the same...
0
1850
by: fragmonster | last post by:
Hi, I have a .NET Web Service. I must write a client in PHP5. I've got a problem with the formatting of my SoapHeader. In fact, the prefix of the namespace does not apply to the entire header node and child nodes: Here is my PHP Soap message : =========================== <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
0
10125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9963
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
11512
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
11281
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,...
0
10649
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9853
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7377
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
6072
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
4900
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

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.