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 through sql tables

search through sql tables

Scheduled Pinned Locked Moved C#
database
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.
  • P Offline
    P Offline
    piticcotoc
    wrote on last edited by
    #1

    I have a database with 3 tables: pc, printer, scale. All 3 tables have fileds hostname, ip_address and serial_number. I've designed a form to search any of these tables by host, ip and sn. I'm having trouble making the search go through all 3 tables and return if something is found. Like is i search for host "comp" if it's a pc it returns the values from table pc, if it's a printer returns values from table printer. The same for the other fields.

    C 1 Reply Last reply
    0
    • P piticcotoc

      I have a database with 3 tables: pc, printer, scale. All 3 tables have fileds hostname, ip_address and serial_number. I've designed a form to search any of these tables by host, ip and sn. I'm having trouble making the search go through all 3 tables and return if something is found. Like is i search for host "comp" if it's a pc it returns the values from table pc, if it's a printer returns values from table printer. The same for the other fields.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Where are you having problems ? It sounds to me like a poor DB design, you probably wanted one table with a column that tells you if it's a PC, a printer, etc. Either way, it sounds like you're saying you can't get the SQL right, which makes this a SQL question. Posting the SQL would sure help us to help you.

      Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

      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