Click here to Skip to main content
15,879,348 members
Home / Discussions / C#
   

C#

 
AnswerRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 3:02
mveOriginalGriff28-Apr-16 3:02 
GeneralRe: Drag and drop file explorer Pin
AndrewRue28-Apr-16 3:11
professionalAndrewRue28-Apr-16 3:11 
GeneralRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 3:26
mveOriginalGriff28-Apr-16 3:26 
GeneralRe: Drag and drop file explorer Pin
AndrewRue28-Apr-16 19:50
professionalAndrewRue28-Apr-16 19:50 
GeneralRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 20:54
mveOriginalGriff28-Apr-16 20:54 
GeneralRe: Drag and drop file explorer Pin
AndrewRue28-Apr-16 21:27
professionalAndrewRue28-Apr-16 21:27 
GeneralRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 22:44
mveOriginalGriff28-Apr-16 22:44 
QuestionShouldnt this work? Pin
David Reeves27-Apr-16 12:25
David Reeves27-Apr-16 12:25 
C#
foreach (DataRow dataRow in dt.Rows)
            {
                if (dataRow["Column1"].ToString().Contains(["ExampleString"])
                {
                    
                    listBox1.Items.Add(dataRow["Column1"] + " " + dataRow["Column2"] + "  " + dataRow["Column3"] + " " + dataRow["Column4"]);

                }
            }


//the above code works perfectly and returns only the rows containing the "ExampleString"


// if i try to use a SelectedText value from a combobox as a string to replace the "ExampleString", (as shown below),the listbox populates with ALL of the rows, not just the ones with the "ExampleString".  




string strFromCombobox = comboBox1.SelectedText;

foreach (DataRow dataRow in dt.Rows)
            {
                if (dataRow["Column1"].ToString().Contains(strFromCombobox)
                {
                    
                    listBox1.Items.Add(dataRow["Column1"] + " " + dataRow["Column2"] + "  " + dataRow["Column3"] + " " + dataRow["Column4"]);

                }
            }

AnswerRe: Shouldnt this work? Pin
Dave Kreskowiak27-Apr-16 13:54
mveDave Kreskowiak27-Apr-16 13:54 
AnswerRe: Shouldnt this work? Pin
Brisingr Aerowing27-Apr-16 14:21
professionalBrisingr Aerowing27-Apr-16 14:21 
GeneralRe: Shouldnt this work? Pin
David Reeves27-Apr-16 14:40
David Reeves27-Apr-16 14:40 
GeneralRe: Shouldnt this work? Pin
Philippe Mori27-Apr-16 15:57
Philippe Mori27-Apr-16 15:57 
GeneralRe: Shouldnt this work? Pin
Sascha Lefèvre27-Apr-16 21:27
professionalSascha Lefèvre27-Apr-16 21:27 
GeneralRe: Shouldnt this work? Pin
David Reeves28-Apr-16 1:18
David Reeves28-Apr-16 1:18 
QuestionUsing a scripting language in a C# exe Pin
Foothill27-Apr-16 8:37
professionalFoothill27-Apr-16 8:37 
AnswerRe: Using a scripting language in a C# exe Pin
Pete O'Hanlon27-Apr-16 9:22
mvePete O'Hanlon27-Apr-16 9:22 
GeneralRe: Using a scripting language in a C# exe Pin
Foothill27-Apr-16 9:41
professionalFoothill27-Apr-16 9:41 
AnswerRe: Using a scripting language in a C# exe Pin
Sascha Lefèvre27-Apr-16 10:05
professionalSascha Lefèvre27-Apr-16 10:05 
GeneralRe: Using a scripting language in a C# exe Pin
Foothill27-Apr-16 11:19
professionalFoothill27-Apr-16 11:19 
GeneralRe: Using a scripting language in a C# exe Pin
Brisingr Aerowing27-Apr-16 17:24
professionalBrisingr Aerowing27-Apr-16 17:24 
AnswerRe: Using a scripting language in a C# exe Pin
Brisingr Aerowing27-Apr-16 17:31
professionalBrisingr Aerowing27-Apr-16 17:31 
GeneralRe: Using a scripting language in a C# exe Pin
Foothill28-Apr-16 3:23
professionalFoothill28-Apr-16 3:23 
GeneralRe: Using a scripting language in a C# exe Pin
Brisingr Aerowing28-Apr-16 7:46
professionalBrisingr Aerowing28-Apr-16 7:46 
AnswerRe: Using a scripting language in a C# exe Pin
BillWoodruff27-Apr-16 20:13
professionalBillWoodruff27-Apr-16 20:13 
GeneralRe: Using a scripting language in a C# exe Pin
Foothill28-Apr-16 3:31
professionalFoothill28-Apr-16 3:31 

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.