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. Database & SysAdmin
  3. Database
  4. Search in textbox

Search in textbox

Scheduled Pinned Locked Moved Database
helpcss
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.
  • U Offline
    U Offline
    User 10689935
    wrote on last edited by
    #1

    Hello, I created table and loaded it on data-grid view. MySqlCommand cmddatabase = new MySqlCommand("select number as 'رقم', date as'تاريخ ',name as (أسم);", condatabase); Now i want search on the name from textbox. So i did like this private void txt_in11_TextChanged(object sender, EventArgs e) { DataView dv = new DataView(dbdataset); dv.RowFilter = string.Format(" 'name' LIKE '%{0}%'",txt_in11.Text); dataGridView1.DataSource = dv; } My problem when i search on the name nothing appear in the table. it appear is clear although i inserted in the table some rows. So please can any one help me in this .

    Richard DeemingR 1 Reply Last reply
    0
    • U User 10689935

      Hello, I created table and loaded it on data-grid view. MySqlCommand cmddatabase = new MySqlCommand("select number as 'رقم', date as'تاريخ ',name as (أسم);", condatabase); Now i want search on the name from textbox. So i did like this private void txt_in11_TextChanged(object sender, EventArgs e) { DataView dv = new DataView(dbdataset); dv.RowFilter = string.Format(" 'name' LIKE '%{0}%'",txt_in11.Text); dataGridView1.DataSource = dv; } My problem when i search on the name nothing appear in the table. it appear is clear although i inserted in the table some rows. So please can any one help me in this .

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Your DataView doesn't contain a column called "name"; it contains a column called "(أسم)". Either change your RowFilter to match the column alias, or change the column alias to match your RowFilter.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      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