473,785 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how does using work?

AAJ
Hi all

I have the following that looks at a XSD Table adapter

JobDescription. VWJobDescriptio nMinEducationDa taTable m_MinQuals;

but for compactness I would like to reference it as

Using JobDescription;

VWJobDescriptio nMinEducationDa taTable 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\wwwr oot\...' when I build the project

can anyone help

Andy

Nov 16 '06 #1
3 2800
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. VWJobDescriptio nMinEducationDa taTable;

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. VWJobDescriptio nMinEducationDa taTable m_MinQuals;

but for compactness I would like to reference it as

Using JobDescription;

VWJobDescriptio nMinEducationDa taTable 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\wwwr oot\...' 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 VWJobDescriptio nMinEducationDa taTable=
JobDescription. VWJobDescriptio nMinEducationDa taTable

Then you could write

VWJobDescriptio nMinEducationDa taTable m_MinQuals;

HTH
Ciaran O'Donnell

"AAJ" wrote:
Hi all

I have the following that looks at a XSD Table adapter

JobDescription. VWJobDescriptio nMinEducationDa taTable m_MinQuals;

but for compactness I would like to reference it as

Using JobDescription;

VWJobDescriptio nMinEducationDa taTable 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\wwwr oot\...' 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******** ******@TK2MSFTN GP03.phx.gbl...
Hi all

I have the following that looks at a XSD Table adapter

JobDescription. VWJobDescriptio nMinEducationDa taTable m_MinQuals;

but for compactness I would like to reference it as

Using JobDescription;

VWJobDescriptio nMinEducationDa taTable 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\wwwr oot\...' 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
4860
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 InternetExplorer But then I cant see when a user exit my objIExplorer and than an error will show up when I try to open a link in the IE window that does not exist... What can I do about this and way does it not work in win 98?
30
3482
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 I've also heard there are lots of weird ways to do some things kinda like Perl which is bad for me. Any other ideas?
8
4376
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 somebody explain it to me? I am using MSVC 6.0. Thanks a lot,
2
5161
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 I am new to this. Full code below : using System; using System.Collections; using System.ComponentModel;
5
2885
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. I open a new project based on a windows form 2. I click on "data" and then "Add New Data Source" then I click on next within the wizard 3. I have 3 choices Database, Local Database, Web service and Object. 4. I choose Database, click next and get...
1
2643
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 app.dev cbt course and for some reason it doesn't work for me does someone know what I doing wrong
14
4863
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 can be done using the designer but I intentionally don't want to use that. The one reason is that you cannot change the code generated by the designer. The other could be that you have more free hand and control to design your GUI. 2....
3
2029
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 project and I get the same errors there: Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.
89
6079
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 used." Could anybody tell me why gets() function is dangerous?? Thank you very much. Cuthbert
4
9183
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 contain < not <), while it works when using MSXML2 to do the transform. Does anyone have the same problem and how to make the escape work? Thanks. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
0
9646
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
10346
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...
0
8982
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...
1
7504
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
6742
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
5386
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...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
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.