Results 1 to 5 of 5

Thread: Class won't compile

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Class won't compile

    When I try to compile my class, I keep getting this error.
    error CS0246: The type or namespace name 'Dictionary' could not be found (are your missing a using directive or an assembly reference?)

    error CS0246: The type or namespace name 'dict' could not be found (are you missing a using directive or an assembly reference?)
    I am writing the code in notepad and compiling with the command line.

    here's my code

    Code:
    using System;
    using System.Collections;
    
    class CH1_12 {
    
    	public static void Main()
    	{
    		Dictionary dict = new Dictionary();
    
    		dict.Add(1, "C++");
    		dict.Add(2, "C");
    		dict.Add(3, "Ada");
    		dict.Add(4, "APL");
    		dict.Add(5, "VB");
    		dict.Add(6, "C#");
    		dict.Add(7, "Java");
    		dict.Add(8, "FORTRAN");
    
    		//Print out the list
    		Console.WriteLine("Before Deleting Anything");
    		
    		foreach(DictionaryEntry de in dict)
    		{
    			Console.WriteLine("Entry Key {0} Value {1}", de.Key, de.Value);
    		}
    
    		dict.Remove(4);
    		dict.Remove(7);
    	
    		Console.WriteLine("After Deletions");
    		
    		foreach(DictionaryEntry de in dict)
    		{
    			Console.WriteLine("Entry Key {0} Value {1}", de.Key, de.Value);
    		}		
    
    	}
    }
    and ideas on what's going on?????
    Last edited by Memnoch1207; Jul 8th, 2003 at 10:56 PM.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width