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

  • Thread starter Thread starter nadeem_far
  • Start date Start date
N

nadeem_far

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
 
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.
 
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 said:
Hi NS,


Prefix it with '@':

///
@class inst = new @class();
///


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top