Home
|
Articles
|
Namespace
|
Interview Questions
|
Tools
|
Jobs
|
Projects
|
Community
»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books
»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects
»Competition
Community
Winners
Prizes
Write For Us
Members
»Other Resources
Links
Dotnet Resources
Forums
»
ASP.NET Forums»
how to get a record from database if we give conditions with blank spaces
how can i get a particular record from database when i give the where condition with blank spaces... for example.... i have text box.their i enter name..according to that name the person record is displaying in grid but if i give name to be searched with space in front and end of the text means the record is not displaying.in other words the name is stored without spaces (front and end)in database.now how can i take that record if i give data with spaces. Example... if i need to get record of a person name called XXX. select * from tablename where EmpName like '%'+@SearchText+'%' here SearchText is parameter. for above it will work finely when searchtext should not have spaces in front and rear end that is 'XXX' but it will not work if i give 'XXX ' or ' XXX' inside text box.. can you help...?
Showing spaces in parameter passed to stored proc
I don't understand why you are allowing names to be created with spaces at the beginning and end of your name entered. You should use .Trim() to remove the spaces at the beginning and end of value entered into your textbox. Nathan
© 2008 dotnetwatch.com --
Privacy policy
Website Design
&
Internet Marketing
by Shivam