1 Replies - 407 Views - Last Post: 04 December 2016 - 09:08 AM

#1 Doobie12  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 05-March 16

Mysql Query Replacement String C#

Posted 04 December 2016 - 09:03 AM

down vote
favorite
I am trying to take a value from my GUI and use it in my query. How can I go about this using C#? I am trying to use the GUI value to replace the 'cid'.

 string query = "SELECT firstname, lastname, quanitybought FROM customers s, beersbought a WHERE exists(SELECT 'x' FROM beersbought b WHERE b.cid = s.cid)";


Is there a way to replace the cids with the value I receive from my GUI? For example Where b.GUIVALUE = s.GUIVALUE.

Is This A Good Question/Topic? 0
  • +

Replies To: Mysql Query Replacement String C#

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13568
  • View blog
  • Posts: 54,135
  • Joined: 12-June 08

Re: Mysql Query Replacement String C#

Posted 04 December 2016 - 09:08 AM

You would use parameters to hold the place, and then fill that parameter with your GUI value.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1