473,503 Members | 2,435 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# "class reserve" word used as a class name?

Hello All,

I have a couple of questions and I am not able to find them any where
on internet.

1. We are using a third party class library which exposes a class with
the name of "class".

Now how can i create an object of this "class" class as class is a
reserve word in C#.

We are using c#.
2. How do you create a webservice object if the webservice class in
sitting in another namespace?
Thanks.

NS

Jun 25 '06 #1
3 2267

<na********@yahoo.com> wrote in message
news:11**********************@y41g2000cwy.googlegr oups.com...
Hello All,

I have a couple of questions and I am not able to find them any where
on internet.

1. We are using a third party class library which exposes a class with
the name of "class".

Now how can i create an object of this "class" class as class is a
reserve word in C#.


use @class notation.
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
Jun 25 '06 #2
na********@yahoo.com wrote:
Hello All,

I have a couple of questions and I am not able to find them any where
on internet.

1. We are using a third party class library which exposes a class with
the name of "class".

Now how can i create an object of this "class" class as class is a
reserve word in C#.

We are using c#.
2. How do you create a webservice object if the webservice class in
sitting in another namespace?
Thanks.

NS
Hi NS,
1. We are using a third party class library which exposes a class with
the name of "class".
Prefix it with '@':

///
@class inst = new @class();
///
2. How do you create a webservice object if the webservice class in
sitting in another namespace?


Do you mean in another namespace, in your code? Or in a totally different
assembly?

Either way, to access by namespace, you can either import the namespace with
a 'using' directive, or fully-qualify the type name when trying to use it:

using <namespace>;

(Using directives *must* be at the top of your code file, or the top of a
namespace declaration)

And if the class resides in a different assembly, you need to reference that
assembly when compiling. In the VS .NET IDE, just right-click
on 'Refernces' and choose 'Add Reference...' then browse for the assembly.

Hope this helps,
-- Tom Spink
Jun 25 '06 #3
Tom Spink wrote:
na********@yahoo.com wrote:
Hello All,

I have a couple of questions and I am not able to find them any where
on internet.

1. We are using a third party class library which exposes a class with
the name of "class".

Now how can i create an object of this "class" class as class is a
reserve word in C#.

We are using c#.
2. How do you create a webservice object if the webservice class in
sitting in another namespace?
Thanks.

NS


Hi NS,
1. We are using a third party class library which exposes a class with
the name of "class".


Prefix it with '@':

///
@class inst = new @class();
///
2. How do you create a webservice object if the webservice class in
sitting in another namespace?


Do you mean in another namespace, in your code? Or in a totally different
assembly?

Either way, to access by namespace, you can either import the namespace with
a 'using' directive, or fully-qualify the type name when trying to use it:

using <namespace>;

(Using directives *must* be at the top of your code file, or the top of a
namespace declaration)

And if the class resides in a different assembly, you need to reference that
assembly when compiling. In the VS .NET IDE, just right-click
on 'Refernces' and choose 'Add Reference...' then browse for the assembly.

Hope this helps,
-- Tom Spink


Tom/Miha,

Thanks for your help.

NS

Jun 26 '06 #4

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

Similar topics

4
2472
by: Jian H. Li | last post by:
Hello, What's the essential differences between the two ways of "class::member" & "object.member"(or object_pointer->member)? class C{ public: void f() {} int i; };
5
1945
by: Rob | last post by:
In many articles related to VB.net the word "class" is used... How many meanings are there to this word ? "possible to derived a class from another" "forms are full-fledged classes" "base...
48
4705
by: mahurshi | last post by:
I am new to c++ classes. I defined this "cDie" class that would return a value between 1 and 6 (inclusive) It runs fine and gives no warnings during compilation. I was wondering if you guys...
45
3380
by: Gregory Petrosyan | last post by:
1) From 2.4.2 documentation: There are two new valid (semantic) forms for the raise statement: raise Class, instance raise instance 2) In python: >>> raise NameError Traceback (most recent...
0
7188
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
7063
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
7258
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
7313
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6970
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
7441
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...
0
5558
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,...
1
4987
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...
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.