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. Where in('aa','na'dn') Problem

Where in('aa','na'dn') Problem

Scheduled Pinned Locked Moved ASP.NET
helpcsharpdatabasemysql
4 Posts 3 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.
  • W Offline
    W Offline
    wEb GuRu
    wrote on last edited by
    #1

    hi I am using a query like select * from cars where car_make in('BMW','Mercedes','Accura') But it gives an error if I use Single Qoute in any car_make for example... select * from cars where car_make in('BMW','Mercedes','Accura','infin'it') I am using MySQL with vb.net. THanks in advance Lets work it Out.........!

    B J 2 Replies Last reply
    0
    • W wEb GuRu

      hi I am using a query like select * from cars where car_make in('BMW','Mercedes','Accura') But it gives an error if I use Single Qoute in any car_make for example... select * from cars where car_make in('BMW','Mercedes','Accura','infin'it') I am using MySQL with vb.net. THanks in advance Lets work it Out.........!

      B Offline
      B Offline
      benqazou
      wrote on last edited by
      #2

      If you were using SQL Server, you would have to write : select * from cars where car_make in('BMW','Mercedes','Accura','infin**''**it') For MySQL I am not sure, but try it this way.. I hope it'll work.

      B 1 Reply Last reply
      0
      • W wEb GuRu

        hi I am using a query like select * from cars where car_make in('BMW','Mercedes','Accura') But it gives an error if I use Single Qoute in any car_make for example... select * from cars where car_make in('BMW','Mercedes','Accura','infin'it') I am using MySQL with vb.net. THanks in advance Lets work it Out.........!

        J Offline
        J Offline
        J4amieC
        wrote on last edited by
        #3

        Use parameterised queries, or replace the quote with two quotes.

        1 Reply Last reply
        0
        • B benqazou

          If you were using SQL Server, you would have to write : select * from cars where car_make in('BMW','Mercedes','Accura','infin**''**it') For MySQL I am not sure, but try it this way.. I hope it'll work.

          B Offline
          B Offline
          benqazou
          wrote on last edited by
          #4

          In fact these are two single quotes (not a double quote).

          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