Results 1 to 4 of 4

Thread: web form using asp.net programming language

  1. #1
    BellWard is offline Senior Member
    Join Date
    Dec 2009
    Posts
    236
    Rep Power
    3

    Default web form using asp.net programming language

    Hello everyone, I am building one web form using asp.net programming language. in that web form I have two combobox and i have some items in both combobox now i want to check the item in both combobox if same item is available in both combobox i want to show that item in message box.

  2. #2
    CoxWatson is offline Senior Member
    Join Date
    Dec 2009
    Posts
    232
    Rep Power
    3

    Default

    Check the following code which may solve your problem:

    Code:
    For inti As Integer = 0 To ComboBox1.Items.Count 
          For intj As Integer = 0 To ComboBox2.Items.Count 
              If ComboBox1.Items(inti).ToString =  
    ComboBox2.Items(intj).ToString Then
                 MessageBox.Show(ComboBox1.Items(inti))
              End If
          Next
      Next

  3. #3
    BrooksGray is offline Senior Member
    Join Date
    Dec 2009
    Posts
    231
    Rep Power
    3

    Default

    The script that I have mentioned will definitely help you.

    Code:
    for (int i = 0; i <= comboBox1.Items.Count-1; i++)
    {
       for (int j = 0; j <= comboBox2.Items.Count-1; j++)
       {
          if (comboBox1.Items[i].ToString() == comboBox2.Items
    [j].ToString())
              MessageBox.Show(comboBox1.Items[i].ToString());
         }
    }

  4. #4
    CruzPowell is offline Senior Member
    Join Date
    Dec 2009
    Posts
    224
    Rep Power
    3

    Default

    Code:
    foreach (string item1 in comboBox1.Items)
          {
             foreach (string item2 in comboBox2.Items)
             if (item1 == item2)
                {
                   MessageBox.Show(item1);
                }
           }

Similar Threads

  1. learning C programming language
    By HernandezOrtiz in forum Programming
    Replies: 1
    Last Post: 02-19-2010, 01:27 PM
  2. JAVA programming language
    By SmithJohnson in forum Programming
    Replies: 1
    Last Post: 02-19-2010, 12:52 PM
  3. Most Useful Linux Related Programming Language(s)
    By Damario Elonzo in forum Linux/Free BSD
    Replies: 2
    Last Post: 08-18-2009, 07:05 AM
  4. GNUSim8085 Assembly language programming
    By uncosto46 in forum Programming
    Replies: 0
    Last Post: 08-02-2008, 11:11 AM
  5. Erlang a programming language
    By ostin55 in forum Programming
    Replies: 0
    Last Post: 07-30-2008, 06:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48