Results 1 to 3 of 3

Thread: [2008] How to select data from sql table to string value?

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    59

    Red face [2008] How to select data from sql table to string value?

    Hi All:
    my sql2008 table is :
    HTML Code:
    T1:
    
     Code(*)     Genus
     --------     ------  
      SA10           A1
      SA11           A2
      SA12           A3
    Code:
            Dim a As New DataTable
            Dim b As New SqlDataAdapter
            b.SelectCommand = New SqlCommand("SELECT * FROM T1 ORDER BY Genus ASC", M)
            b.Fill(a)
            ComboBox1.DataSource = a
            ComboBox1.DisplayMember = "Genus"
    I want when select item from combobox1 then filled Selecteditem(from Combobox1) 'Code' to string value.
    how to do?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2008] How to select data from sql table to string value?

    Code:
    "SELECT genus FROM T1 WHERE CODE = '" & Combobox1.Text & "' "
    Is that what you mean?

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    59

    Re: [2008] How to select data from sql table to string value?

    Thanks Hack.

Posting Permissions

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



Click Here to Expand Forum to Full Width