.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 7th, 2003, 11:12 AM
hazrah8 hazrah8 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 hazrah8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
C# Compilation Errors please help

I'm getting compilation error "The variable 'dest' is declared but never used" on following code segment
foreach( Destination dest in this.destinationList)
{
//Do something
}
the comiler seems to be know the Destination class and destinationList. Any Idea what would cause this error.

I've another compilation error in a differnt scenerio.

In my C# file ABC.cs I have two classes (let say classA and ClassB) written under the same namespace N. From my another C# file XYZ.cs I call the "using N" directive to make use of the methods in the ClassA and classB.
However, I have no problem accessing the methods of classA but for classB I get "The type or namespace name 'ClassB' could not be found (are you missing a using directive or an assembly reference?)
"
Here's how I'm calling it in XYZ.cs

using N;
classB B = new classB();
Just to provide more detail, I had the classA written previously and then I added classB to the same namespace. Are there any restrictions around that? or my Visual Studio.NET is creating this problem? I'm not sure I'm lost. Please help.

Reply With Quote
  #2  
Old October 13th, 2003, 01:47 AM
rdoekes rdoekes is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Strasbourg, France
Posts: 181 rdoekes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 20 sec
Reputation Power: 16
Send a message via AIM to rdoekes Send a message via Yahoo to rdoekes
Re: C# Compilation Errors please help

Quote:
Originally posted by hazrah8
I'm getting compilation error "The variable 'dest' is declared but never used" on following code segment
foreach( Destination dest in this.destinationList)
{
//Do something
}
the comiler seems to be know the Destination class and destinationList. Any Idea what would cause this error.


It seems that the destinationList is empty, since dest is not used. could you test the number of items in your destinationList first before you loop?
__________________
- Rogier Doekes

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > C# Compilation Errors please help


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap