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. searching

searching

Scheduled Pinned Locked Moved Database
databasecsharpalgorithms
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.
  • M Offline
    M Offline
    m m _2007
    wrote on last edited by
    #1

    i want to search for specific row in database: first: stored procedure create procedure search @name varchar (50) as select * from members where name = @name second:C# -create connection and open it -create command and set it to stored procedure -create parameter and pass value i want to search for to that parameter i want to know the index of that row sotred procedure returned to pass it to : DataRow dataRow = dataTable.Rows[index] to fill textboxs of other fields "phone,hire_date,email,..." textbox.text = dataRow["phone"];

    E 1 Reply Last reply
    0
    • M m m _2007

      i want to search for specific row in database: first: stored procedure create procedure search @name varchar (50) as select * from members where name = @name second:C# -create connection and open it -create command and set it to stored procedure -create parameter and pass value i want to search for to that parameter i want to know the index of that row sotred procedure returned to pass it to : DataRow dataRow = dataTable.Rows[index] to fill textboxs of other fields "phone,hire_date,email,..." textbox.text = dataRow["phone"];

      E Offline
      E Offline
      Edbert P
      wrote on last edited by
      #2

      :confused: If your Stored Procedure only returns one result (because the field 'name' is unique) then the index would be 0, which is the first row in the DataSet/DataTable that you filled using the Stored Procedure.

      "A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin Edbert Sydney, Australia

      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