Forum guidelines
AuthorQuestion
Insert Specific Datatype value in HashTable
Posted on: 07 Jan 2014
I have a hashtable
Hashtable _hashTable = new Hashtable().
 
In this hashtable i want add only bool value .
 
_hashTable .Add(1, "false");
_hashTable .Add(2, "false");
_hashTable .Add(a, "true");
bcoz i need to assign this value in the below variable. 
bool _isindian = _hashTable[key].
is it possible to assign those _hashTable value in the _isindian variable ? 
Please advice. 


AuthorReply
Re: Insert Specific Datatype value in HashTable
Posted on: 07 Jan 2014  
It is possible though I'd insert them as bool rather than string constants:

_hashTable .Add(1, false);
_hashTable .Add(2, false);
_hashTable .Add(a, true); 

bool _isindian = (bool)_hashTable[key].

Employers - Post Free Jobs

SPONSORED BY

Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.