Click here to Skip to main content
15,907,905 members
Home / Discussions / C#
   

C#

 
GeneralRe: parameter comments for a method wont work fine Pin
mohammadkaab22-Oct-12 0:34
mohammadkaab22-Oct-12 0:34 
GeneralRe: parameter comments for a method wont work fine Pin
Eddy Vluggen22-Oct-12 0:52
professionalEddy Vluggen22-Oct-12 0:52 
Questionwhat does this error mean? Pin
Member 939900720-Oct-12 18:33
Member 939900720-Oct-12 18:33 
AnswerRe: what does this error mean? Pin
Brisingr Aerowing20-Oct-12 19:16
professionalBrisingr Aerowing20-Oct-12 19:16 
Questionhow I can make the intranet developed in c # to connect to several database in SQL Server 2008 R2 Pin
jaime durand20-Oct-12 18:28
professionaljaime durand20-Oct-12 18:28 
AnswerRe: how I can make the intranet developed in c # to connect to several database in SQL Server 2008 R2 Pin
uspatel20-Oct-12 19:03
professionaluspatel20-Oct-12 19:03 
AnswerRe: how I can make the intranet developed in c # to connect to several database in SQL Server 2008 R2 Pin
Mycroft Holmes21-Oct-12 16:16
professionalMycroft Holmes21-Oct-12 16:16 
Questionerror "object reference not set to an instance of an object" c# Pin
madimboo20-Oct-12 12:30
madimboo20-Oct-12 12:30 
AnswerRe: error "object reference not set to an instance of an object" c# Pin
Richard Andrew x6420-Oct-12 13:48
professionalRichard Andrew x6420-Oct-12 13:48 
AnswerRe: error "object reference not set to an instance of an object" c# Pin
Dave Kreskowiak20-Oct-12 20:48
mveDave Kreskowiak20-Oct-12 20:48 
AnswerRe: error "object reference not set to an instance of an object" c# Pin
Eddy Vluggen21-Oct-12 0:32
professionalEddy Vluggen21-Oct-12 0:32 
AnswerRe: error "object reference not set to an instance of an object" c# Pin
Abhinav S21-Oct-12 17:47
Abhinav S21-Oct-12 17:47 
QuestionChatting application in C# Pin
speedchandu20-Oct-12 11:27
speedchandu20-Oct-12 11:27 
AnswerRe: Chatting application in C# Pin
Richard Andrew x6420-Oct-12 13:49
professionalRichard Andrew x6420-Oct-12 13:49 
GeneralRe: Chatting application in C# Pin
speedchandu20-Oct-12 18:55
speedchandu20-Oct-12 18:55 
AnswerRe: Chatting application in C# Pin
uspatel20-Oct-12 19:10
professionaluspatel20-Oct-12 19:10 
GeneralRe: Chatting application in C# Pin
speedchandu22-Oct-12 21:57
speedchandu22-Oct-12 21:57 
QuestionRe: Chatting application in C# Pin
Eddy Vluggen21-Oct-12 0:32
professionalEddy Vluggen21-Oct-12 0:32 
QuestionDataTable not Visible Outside of using Block Pin
ASPnoob20-Oct-12 4:52
ASPnoob20-Oct-12 4:52 
AnswerRe: DataTable not Visible Outside of using Block Pin
Pete O'Hanlon20-Oct-12 5:13
mvePete O'Hanlon20-Oct-12 5:13 
AnswerRe: DataTable not Visible Outside of using Block Pin
Dave Kreskowiak20-Oct-12 6:44
mveDave Kreskowiak20-Oct-12 6:44 
QuestionAdding Elements of a List to Another List Pin
ASPnoob20-Oct-12 2:40
ASPnoob20-Oct-12 2:40 
Hi All,
I am trying to add an element from List1 to List2 if it is not already in List2. The following is what I have and I'm getting the error message List1 is a variable but is used like a method.
C#
List<RadioButton> List2 = new List<RadioButton>();
List<RadioButton> List1 = new List<RadioButton>();

            //Add a dummy value to first index
            List1.Add(0,null);
            List1.Add(1,RadioButton1);
            List1.Add(2,RadioButton2);
            List1.Add(3,RadioButton3);
            List1.Add(4,RadioButton4);

//Generate random List index 
int listIndex = RandNum.Next(1, 4);

int i=1;
while(i<List1.Count)
{
//Check if the radiobutton at index of Listindex in List1 is in List2
 if (!List2.Contains(List1(listIndex )))
     {
       //If radiobutton did not exist in List2, add it to List2
       List2.Add(List1(listIndex ));                               
       i++;
     }
}


Please explain what I am doing wrong. Thanks in advance.

modified 20-Oct-12 8:59am.

AnswerRe: Adding Elements of a List to Another List Pin
Richard MacCutchan20-Oct-12 3:01
mveRichard MacCutchan20-Oct-12 3:01 
GeneralRe: Adding Elements of a List to Another List Pin
ASPnoob20-Oct-12 3:58
ASPnoob20-Oct-12 3:58 
GeneralRe: Adding Elements of a List to Another List Pin
Richard MacCutchan20-Oct-12 4:05
mveRichard MacCutchan20-Oct-12 4:05 

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.