Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET SQL TSQL
Trying to pull a specific column, using a select statement with a where clause. I know this username kimS is in the row username, but I keep getting the error 'Invalid Column Name'. This is probably so simple that its not funny but Im a newb and this is pissing me off, lol. Thanks for any help available.
 
SELECT *
FROM  Users Where Username = kimS
Posted 1-Nov-12 5:47am
JasonMacD1.6K

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

SELECT * FROM Users WHERE Username = 'kimS'
Literal strings always need to be enclosed in single quotes. Cheers.
  Permalink  
Comments
JasonMacD at 1-Nov-12 11:02am
   
Thanks Marcus, had a brain fart, lol!!
Marcus Kramer at 1-Nov-12 13:34pm
   
No worries. We all have them more often than we like to admit. Cheers.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 OriginalGriff 120
3 PIEBALDconsult 110
4 BillWoodruff 85
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100