Manish Pansiniya's Blog

.NET, C#, Javascript, ASP.NET and lots more…:)

The name "UserName" is not permitted in this context. Valid expressions are constants, constant expressions…

with one comment

I got above error while doing following thing in a hurry. I could not find at first look that it is not valid.

INSERT INTO [Users]
           ([UserId]
           ,[Username]
           )
     VALUES
           (24
            ,"Manish")

Now, the problem is simple but could not find it at first look. I used double quotes ā€œ instead of single quote ā€˜.

Replaced it and gone šŸ™‚ Thought, i should share šŸ˜‰

Advertisements

Written by Manish

June 10, 2010 at 5:29 pm

Posted in .NET, .NET 3.0

One Response

Subscribe to comments with RSS.

  1. Got same error, but with me using double quotes. Tried using single quote when I read this and it works! šŸ˜€

    jao me

    November 19, 2011 at 9:31 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: