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

how does using work?

AAJ
Hi all

I have the following that looks at a XSD Table adapter

JobDescription.VWJobDescriptionMinEducationDataTab le m_MinQuals;

but for compactness I would like to reference it as

Using JobDescription;

VWJobDescriptionMinEducationDataTable m_MinQuals;

but the 'using' part generates 'Error 1 A using namespace directive can only
be applied to namespaces; 'JobDescription' is a type not a namespace
E:\Inetpub\wwwroot\...' when I build the project

can anyone help

Andy

Nov 16 '06 #1
3 2778
Hi Andy,

I would guess that JobDescription is a class, and that VWJob...Table is a
member of that class. In that case you would have to create an alias.

using JDescMinTable = JobDescription.VWJobDescriptionMinEducationDataTab le;

JDescMinTable m_MinQuals;

On Thu, 16 Nov 2006 13:48:27 +0100, AAJ <a.a.comwrote:
Hi all

I have the following that looks at a XSD Table adapter

JobDescription.VWJobDescriptionMinEducationDataTab le m_MinQuals;

but for compactness I would like to reference it as

Using JobDescription;

VWJobDescriptionMinEducationDataTable m_MinQuals;

but the 'using' part generates 'Error 1 A using namespace directive can
only
be applied to namespaces; 'JobDescription' is a type not a namespace
E:\Inetpub\wwwroot\...' when I build the project

can anyone help

Andy


--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '06 #2
In C#, using aliases namespaces or classes.
using System.Windows.Forms
aliases System.Windows.Forms as nothingso you can access is members directly.
using Forms = System.Windows.Forms
aliases it as Forms so you can get to TextBox as Forms.TextBox
using TB = System.Windows.Forms.TextBox
aliases the class as TB and there fore you can access it like
TB myTextbox = new TB();

What you need to do for your needs is :

using VWJobDescriptionMinEducationDataTable=
JobDescription.VWJobDescriptionMinEducationDataTab le

Then you could write

VWJobDescriptionMinEducationDataTable m_MinQuals;

HTH
Ciaran O'Donnell

"AAJ" wrote:
Hi all

I have the following that looks at a XSD Table adapter

JobDescription.VWJobDescriptionMinEducationDataTab le m_MinQuals;

but for compactness I would like to reference it as

Using JobDescription;

VWJobDescriptionMinEducationDataTable m_MinQuals;

but the 'using' part generates 'Error 1 A using namespace directive can only
be applied to namespaces; 'JobDescription' is a type not a namespace
E:\Inetpub\wwwroot\...' when I build the project

can anyone help

Andy

Nov 16 '06 #3
AAJ
Thanks guys - its exactly what I was looking for

cheers

Andy
"AAJ" <a.a.comwrote in message
news:u1**************@TK2MSFTNGP03.phx.gbl...
Hi all

I have the following that looks at a XSD Table adapter

JobDescription.VWJobDescriptionMinEducationDataTab le m_MinQuals;

but for compactness I would like to reference it as

Using JobDescription;

VWJobDescriptionMinEducationDataTable m_MinQuals;

but the 'using' part generates 'Error 1 A using namespace directive can
only be applied to namespaces; 'JobDescription' is a type not a namespace
E:\Inetpub\wwwroot\...' when I build the project

can anyone help

Andy

Nov 17 '06 #4

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

Similar topics

7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
30
by: Christian Seberino | last post by:
How does Ruby compare to Python?? How good is DESIGN of Ruby compared to Python? Python's design is godly. I'm wondering if Ruby's is godly too. I've heard it has solid OOP design but then...
8
by: Douglas | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** Hello, The following code does not compile if line 3 is uncommented "using namespace std". I do not understand it. Could...
2
by: Besta | last post by:
Hello all, I am having trouble creating a windows service with a timer. Everything seems to go ok but the elapsed event does not fire.Can anyone shed any light on this, may be something simple as...
5
by: rogsonl | last post by:
My computer was moved last week, and the company changed the network groups we work on. As a result, one of the main benefits from Whidbey (database connectivity) no longer works. Situation: 1....
1
by: sal | last post by:
Greets, All Question with udl and connection string does it work? I'm having problems with the code below I keep getting an error "Keyword not supported 'File Name'" I was just following...
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
3
by: Mark Leistner | last post by:
I am having problems getting a gridview to bind to custom objects under any non-full trust level. I created a test project to verify what I am seeing isn't a side effect of other code in my...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
4
by: Jon | last post by:
Hi, I used XslCompiledTransform with the following Xsl file. The <xsl:text disable-output-escaping="yes"does not work when using XslCompiledTransform to do the trnasform (namely the output...
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.