Friday, July 31, 2009

I'm designing a website using C#.net and i keep getting this error "newline in constant"..help please..

i double click the error to see where it is but it just keeps on highlighting the last parts of some of the lines..when i try to retype the whole statement, it's still there..it usually comes out when i write down codes concerning the dbase..

I'm designing a website using C#.net and i keep getting this error "newline in constant"..help please..
please post the code so i can fix it.
Reply:May be you can contact a C# expert at websites like http://getafreelnacer.com/
Reply:post the code or go to a c# forum
Reply:This means that while your assigning a value to a string, you pressed enter (new line).





To avoid this use the @ marker in the beginning of your string like this:





string CommandText = @" My text goes here and inclues a new line


but it doesn't matter because I marked it with an @


";





When you put an "@" at the beginning of a string, your telling the compiler: "there are no special characters in this string.


Just put exactly what I type into the string."





Hope this helps!


No comments:

Post a Comment