Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 6th, 2011, 11:05 AM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Question LIKE N'%rock%' Chap 12 - Page 413, #6

Imar,

I'm wondering if you have ever seen this before? When I enter a Filter per your instructions, LIKE '%rock%' and capital N is inserted immediately before the 1st percent (%) sign. I can manually remove it, however, as soon as I tab or move away from the Filter column, it is immediatley re-inserted.

It doesn't matter what I type between the percent signs, a capital N is always inserted before the 1st apostrophe. Refer to the title of this message to see exactly what I'm describing to you.

I think it must be a bug in Visual Studio 2010.

Your thoughts, please.

J. Koyle
 
Old September 6th, 2011, 11:11 AM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Exclamation LIKE N'%rock%'

Imar,

I forgot to mention, the code works perfect, even with the capital N inserted. That's whats' so confusing.

Sorry for the 2nd message.

J. Koyle
 
Old September 6th, 2011, 01:59 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It's not a bug in VWD (sorry, Visual Web Developer Express Edition), it's by design. The data type in your SQL database (sorry, Structured Query Language database) is of type nvarchar which is designed to store unicode data. The standard of telling SQL Server (sorry, Structured Query Language Server) that some piece of text is unicode is to prefix it by the captial N. So, N'I hate acronyms' is a perfectly piece of unicode data.

In most situations, you can simply leave it out and it'll still work. VWD (sorry, Visual Web Developer) just makes it explicitly for you.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old September 6th, 2011, 02:26 PM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Smile LIKE N'%rock%' Chap 12 - Page 413, #6

Thanks Imar,

Now it makes sense.

J. Koyle





Similar Threads
Thread Thread Starter Forum Replies Last Post
No sample codes for Chap 12? cJeffreywang BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 1 May 31st, 2011 07:44 AM
chap 12 exer 2 harper BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1 0 January 31st, 2008 10:19 AM
Chap 12 connection to a dbase jardbf BOOK: Beginning ASP 3.0 1 May 25th, 2006 11:01 AM
chap. 12 -cmstables.php niy BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 January 12th, 2005 02:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.