Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Search Results (Win Forms 2.0)

Search Results (Win Forms 2.0)

Scheduled Pinned Locked Moved C#
databasehelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TAREQ F ABUZUHRI
    wrote on last edited by
    #1

    Im building a Search facility and want to return a set of results (Done!) The results are displayed in a GridView, but I want the user to click a row and then that client info will pop up in the text boxes: a Sample: string ConnectionString = "Data Source='db.sdf';"; SqlCeConnection connection = new SqlCeConnection(ConnectionString); connection.Open(); string strLastName = textBox1.Text; string strPostCode = textBox2.Text; string strEmail = textBox3.Text; if (!(textBox1.Text == null)) { string SelectLastName = "SELECT OID, name, lastname, Postcode, Emailad FROM Eaddress WHERE lastname = '" + strLastName + "'"; SqlCeDataAdapter da = new SqlCeDataAdapter(SelectLastName, ConnectionString); DataSet ds = new DataSet(); da.Fill(ds, "Eaddress"); dataGridView1.DataSource = ds; dataGridView1.DataMember = "Eaddress"; } i have two text boxes called textbox1 and textbox2, when user clicks the row the name appears in textbox and lastname appears in textbox2. example would help very much!!

    Palestine

    S 1 Reply Last reply
    0
    • T TAREQ F ABUZUHRI

      Im building a Search facility and want to return a set of results (Done!) The results are displayed in a GridView, but I want the user to click a row and then that client info will pop up in the text boxes: a Sample: string ConnectionString = "Data Source='db.sdf';"; SqlCeConnection connection = new SqlCeConnection(ConnectionString); connection.Open(); string strLastName = textBox1.Text; string strPostCode = textBox2.Text; string strEmail = textBox3.Text; if (!(textBox1.Text == null)) { string SelectLastName = "SELECT OID, name, lastname, Postcode, Emailad FROM Eaddress WHERE lastname = '" + strLastName + "'"; SqlCeDataAdapter da = new SqlCeDataAdapter(SelectLastName, ConnectionString); DataSet ds = new DataSet(); da.Fill(ds, "Eaddress"); dataGridView1.DataSource = ds; dataGridView1.DataMember = "Eaddress"; } i have two text boxes called textbox1 and textbox2, when user clicks the row the name appears in textbox and lastname appears in textbox2. example would help very much!!

      Palestine

      S Offline
      S Offline
      Sean89
      wrote on last edited by
      #2

      Look up textbox databinding.


      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups