Click here to Skip to main content
15,909,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Error   2   'hashtable' is a 'namespace' but is used like a 'type'  visual studio 2010\Projects\hashtable\hashtable\Default.aspx.cs    24  13  hashtable
Posted

import this namespace

C#
using System.Collections;
using System.Collections.Generic; 
 
Share this answer
 
Comments
harshavardhan12345678 29-Jan-14 6:13am    
Warning 1 The using directive for 'System.Collections.Generic' appeared previously in this namespace c:visual studio 2010\Projects\hashtable\hashtable\Default.aspx.cs 15 7 hashtable
Without your code, we can't say exactly, but...the error message does give you the basic info you should need to fix it yourself: See those two numbers at the end? "24 13" are the line and column numbers at which it noticed the problem in your file.

So go to Default.aspx.cs and look at line 24. Something about it is trying to use "hashtable" - you need to look at it, and find out what. The normal problem is that you have a namespace "hashtable" and a class "hashtable" and the compiler isn't sure which you mean. In that case try "hashtable.hashtable" to properly specify exactly what you mean.
 
Share this answer
 
Basically you have created a namespace that ends with Hashtable and then you have attempted to use a Hashtable in your code. If you really need to keep the Hashtable namespace, then you could simply change the declaration of your Hashtable type in code to use the full namespace to identify it:
C#
private System.Collections.Hashtable _hashTable = new System.Collections.Hashtable();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900