473,769 Members | 5,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conflicting namespaces??

I've included both the System.Drawing namespance and the
System.Web.UI.W ebControls namespace on my page. Both of
these have an Image class, so when I call the Image class
(refering to the System.Drawing namespace) can I do it
without having to write the entire string?
System.Drawing. Image... I get errors saying Image is
ambiguous otherwise.
Nov 17 '05 #1
2 1840
Hi

Every namespace and type has a fully qualified name,
which uniquely identifies the namespace or type amongst
all others.

So use fully qualified name.

Ravikanth[MVP]

-----Original Message-----
I've included both the System.Drawing namespance and the
System.Web.UI. WebControls namespace on my page. Both of
these have an Image class, so when I call the Image class(refering to the System.Drawing namespace) can I do it
without having to write the entire string?
System.Drawing .Image... I get errors saying Image is
ambiguous otherwise.
.

Nov 17 '05 #2
"Will" <ws*****@comcas t.net> wrote in
news:0e******** *************** *****@phx.gbl:
I've included both the System.Drawing namespance and the
System.Web.UI.W ebControls namespace on my page. Both of
these have an Image class, so when I call the Image class
(refering to the System.Drawing namespace) can I do it
without having to write the entire string?
System.Drawing. Image... I get errors saying Image is
ambiguous otherwise.


Will,

Both VB.Net and C# support namespace aliases. You can use this
mechanism to give different (usually shorter) names to a specified
namespace.

VB.Net:

Imports Draw = System.Drawing
Imports WebUI = System.Web.UI.W ebControls

' Create a System.Drawing Image:
Dim MyDrawImage As Draw.Image = Draw.Image.From File('myfile.bm p')

' Create a System.Web.UI.W ebControls Image:
Dim MyWebImage As New WebUI.Image()

C#:

using Draw = System.Drawing;
using WebUI = System.Web.UI.W ebControls;

// Create a System.Drawing Image:
Draw.Image MyDrawImage = Draw.Image.From File("myfile.bm p");

// Create a System.Web.UI.W ebControls Image:
WebUI.Image MyWebImage = new WebUI.Image();
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 17 '05 #3

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

Similar topics

18
3051
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of a single collections type, I should be proposing a new "namespaces" module instead. Some of my reasons: (1) Namespace is feeling less and less like a collection to me. Even though it's still intended as a data-only structure, the use cases...
2
3990
by: humble04 | last post by:
Hi, I am compiling a collection of C++ code. Most of them are using the new format #include <iostream>. I think all of them because I failed at finding out which header file uses the old format #include <iostream.h>. However, I met the following error messages. "/usr/vacpp/include/iostream.h", line 74.7: 1540-0400 (S) "class ostream" has a conflicting declaration "../include/myfile.h", line 7.1: 1540-0424 (I) "ostream" is declared on
7
2623
by: Thiru | last post by:
I am writing an application that interacts with Oracle and Teradata. In order to create the executable, I need to link various Oracle and Teradata libraries. I found out that when I link the Oracle and Teradata libraries together, the Teradata API functions are not working properly. My assumption is that these libraries are sharing identical function names and parameter lists and hence the conflicts are causing the problem. Is my...
4
1988
by: Alexander Gorshenev | last post by:
I am looking for an elegant solution for the following problem: I have two projects for which I have to create a kind of bridge or translator between. For each of the projects there exist a set of headers included by practicaly all of the member .c files. For my bridge I would be using all those "main" headers from both of the projects included together. But unfortunately, due to historical reasons, those headers conflict in many...
11
1792
by: Random | last post by:
I'm confused about the proper use and usefulness of namespaces. I beleive I understand the purpose is so the developer can put classes within namespaces to essentially organize your code. And I understand that you declare your intention to use a namespace within a page through the "Inherits" attribute. I know that using "Inherits" isn't absolutely necessary, it's just recommended so the developer doesn't have to type out the entire...
11
3919
by: alex sparsky | last post by:
I have a rather unique problem that I need some advice on. I have multiple c# controls that need to make use of a common namespace. So when I go to include both controls that make use of that common namespace and one control has a newer version of that namespace, the compiler complains about ambiguous references. I've tried using compiler directives to manipulate the namespaces to be different at compile time but vs.net 2005 keeps...
1
1521
by: javatopia | last post by:
Hello! I have a web page named "ChangePassword.aspx", which works just wonderful on my developer machine. When I deploy it to the server, though, I get: Compiler Error Message: CS0030: Cannot convert type 'ASP.changepassword_aspx' to 'System.Web.UI.WebControls.ChangePassword' public changepassword_aspx() { Line 121: string dependencies;
1
1928
by: helraizer1 | last post by:
Hi folks, I have an image based shoutbox which I am currently implementing emoticons onto. I have a way now for the emoticons to appear where the :D or =) etc. is on the image, but for some reason they seem to be conflicting. I shall try to explain. chatbox.php - only necessary code shown $grins = array('=D', "=d", ":d", ":D"); foreach ($grins as $grin) {
12
9136
by: Michael.Z | last post by:
Anyone who can help: Given a Table.h file I am writing a Table.c file. I keep getting the compile error: previous declaration of Table was here / conflicting types for I think the problem was the result of two pieces of code. First: typedef struct Table; /* in Table.c*/
0
10039
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
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
9860
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
8869
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
7406
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
6668
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
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3955
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
3
2814
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.