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. Web Development
  3. ASP.NET
  4. Search Query

Search Query

Scheduled Pinned Locked Moved ASP.NET
databasequestioncsharp
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
    twoods 0
    wrote on last edited by
    #1

    I have an aspx page with 3 textboxes and a submit button. I'm trying to build a query string to return results based on what is entered in the textboxes by the user. Each textbox corresponds to columns in my database. How do I go about building my query string. Please provide code in C# if possible. Thanks,

    L 1 Reply Last reply
    0
    • T twoods 0

      I have an aspx page with 3 textboxes and a submit button. I'm trying to build a query string to return results based on what is entered in the textboxes by the user. Each textbox corresponds to columns in my database. How do I go about building my query string. Please provide code in C# if possible. Thanks,

      L Offline
      L Offline
      Le centriste
      wrote on last edited by
      #2

      string myQuery = "SELECT * FROM MyTable WHERE column1 = '" + textbox1.Text + " AND column2 = '" + textbox2.Text + "' AND column3 = '" + textbox3.Text + "'"; That is not very good but a good start for the student who wants someone else to do his homework.

      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