Click here to Skip to main content
15,887,175 members
Home / Discussions / C#
   

C#

 
AnswerRe: a bad control !!!! Pin
ostad_mrn14-Jun-10 4:24
ostad_mrn14-Jun-10 4:24 
QuestionUSB Reader Pin
S.Aijaz14-Jun-10 3:44
S.Aijaz14-Jun-10 3:44 
Answercross-post Pin
Luc Pattyn14-Jun-10 3:55
sitebuilderLuc Pattyn14-Jun-10 3:55 
QuestionDemo Deployment Pin
eraser95014-Jun-10 3:17
eraser95014-Jun-10 3:17 
AnswerRe: Demo Deployment Pin
Johnny J.14-Jun-10 3:36
professionalJohnny J.14-Jun-10 3:36 
AnswerRe: Demo Deployment Pin
kasraa0009800014-Jun-10 4:34
kasraa0009800014-Jun-10 4:34 
QuestionClass methods for accessing/modifying multiple array variables Pin
BenBJT14-Jun-10 2:59
BenBJT14-Jun-10 2:59 
AnswerRe: Class methods for accessing/modifying multiple array variables Pin
Łukasz Nowakowski14-Jun-10 3:15
Łukasz Nowakowski14-Jun-10 3:15 
Well, the issue here is that "two methods cannot differ in return type only". Here method is indexer (this), but rule is the same. You have three indexers, that only differ in return type, which means, that when you do:
<br />
TestConfig test = new TestConfig();<br />
// Some initialization<br />
Console.WriteLine(test[2]);<br />

Compiler will not know, which indexer you want to call, because Console.WriteLine is overriden for string, int and bool. That's why you cannot create indexers like this. You can however create indexer based on other type, for example string. So you can have
<br />
public int this[int pos]<br />
{<br />
// some implementation of getter and setter<br />
}<br />
<br />
public int this[string pos]<br />
{<br />
// probably another implementation of getter and setter<br />
}<br />


It is possible to do what you want to do, but that would require creation of three additional classes, one for each array you want to store. And indexing would be provided by fields (you have a type StringIndexerTable and field of this type in your TestConfig class).
AnswerRe: Class methods for accessing/modifying multiple array variables Pin
Luc Pattyn14-Jun-10 3:26
sitebuilderLuc Pattyn14-Jun-10 3:26 
Questionhow i know when user created Pin
noamtzu0014-Jun-10 2:47
noamtzu0014-Jun-10 2:47 
AnswerRe: how i know when user created Pin
Pete O'Hanlon14-Jun-10 3:36
mvePete O'Hanlon14-Jun-10 3:36 
GeneralRe: how i know when user created Pin
noamtzu0014-Jun-10 18:33
noamtzu0014-Jun-10 18:33 
QuestionGetting a column or parameter's data type from the database [modified] Pin
JohnLBevan14-Jun-10 1:42
professionalJohnLBevan14-Jun-10 1:42 
AnswerRe: Getting a column or parameter's data type from the database Pin
PIEBALDconsult14-Jun-10 2:44
mvePIEBALDconsult14-Jun-10 2:44 
GeneralRe: Getting a column or parameter's data type from the database Pin
JohnLBevan14-Jun-10 8:40
professionalJohnLBevan14-Jun-10 8:40 
GeneralRe: Getting a column or parameter's data type from the database Pin
PIEBALDconsult14-Jun-10 13:48
mvePIEBALDconsult14-Jun-10 13:48 
QuestionA few questions Pin
SRJ9214-Jun-10 1:12
SRJ9214-Jun-10 1:12 
AnswerRe: A few questions Pin
Eddy Vluggen14-Jun-10 2:08
professionalEddy Vluggen14-Jun-10 2:08 
GeneralRe: A few questions Pin
SRJ9214-Jun-10 10:08
SRJ9214-Jun-10 10:08 
GeneralRe: A few questions Pin
Eddy Vluggen14-Jun-10 10:38
professionalEddy Vluggen14-Jun-10 10:38 
QuestionLogin dialog on page loads Pin
Ramkithepower14-Jun-10 0:39
Ramkithepower14-Jun-10 0:39 
AnswerWrong forum - Try the ASP.NET forum. Pin
Pete O'Hanlon14-Jun-10 0:42
mvePete O'Hanlon14-Jun-10 0:42 
AnswerRe: Login dialog on page loads Pin
OriginalGriff14-Jun-10 0:43
mveOriginalGriff14-Jun-10 0:43 
AnswerRe: Login dialog on page loads Pin
Ramkithepower14-Jun-10 22:21
Ramkithepower14-Jun-10 22:21 
QuestionScalable Email service Pin
nitin_ion14-Jun-10 0:28
nitin_ion14-Jun-10 0:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.