Forums » .NET » .NET »

String Problem


Posted Date: 23 Nov 2009      Posted By:: Narasimha     Member Level: Silver    Member Rank: 2040     Points: 1   Responses: 7




Hi All,

For below code compiler showing errors ....

Code:
string StrPath;
StrPath = "c:\";

Errors:
--New line in Constant
-- ; expected




Responses

#445980    Author: Nathan      Member Level: Gold      Member Rank: 54     Date: 23/Nov/2009   Rating: 2 out of 52 out of 5     Points: 2

Try this
StrPath = "c:\\";

By Nathan
Direction is important than speed
For your reference



 
#445987    Author: Manick Online     Member Level: Gold      Member Rank: 544     Date: 23/Nov/2009   Rating: 2 out of 52 out of 5     Points: 2

StrPath = "c:\\";

If we give the path from any of the frotend tool,we need to give like this.

Regards,
Manick



 
#445989    Author: Nisar      Member Level: Gold      Member Rank: 67     Date: 23/Nov/2009   Rating: 2 out of 52 out of 5     Points: 2

u can also use like this
StrPath = @"c:\";

_______________________________
Nisar Ahmad
DotNetSpider MVM, Badge of Appreciation Award – 2010
Greatness Can't be achieved by doing big things, If you really want to be great, Do small things in Great way.
My Forum






 
#445994    Author: Nagarajan      Member Level: Gold      Member Rank: 306     Date: 23/Nov/2009   Rating: 2 out of 52 out of 5     Points: 2

You May use \\ for that..

Like strpath = "c:\\";

Regards,
NAGARAJAN.R
There is nothing called Luck.. For those who deserve it...



 
#446011    Author: Mukta Aggarwal      Member Level: Silver      Member Rank: 751     Date: 23/Nov/2009   Rating: 2 out of 52 out of 5     Points: 2

Pls use like that...
StrPath = @"c:\";



 
#446170    Author: Nithya      Member Level: Gold      Member Rank: 769     Date: 23/Nov/2009   Rating: 2 out of 52 out of 5     Points: 2

hi,

this can be done in two ways...

You May use \\ for that..
string StrPath;
strpath = "c:\\";

You can also use like this
StrPath = @"c:\";



 
#446679    Author: Avinash Mohan      Member Level: Gold      Member Rank: 258     Date: 24/Nov/2009   Rating: 2 out of 52 out of 5     Points: 2

Hi

plz use path like this
StrPath = @"c:\"; because in C# .NET compiler don"t understand Escape sequesnces So u have to use Verbatims "@"

Thanks and Regards
Avinash Mohan M.R
http://amicably.ning.com



 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : Send data from application to main DB server
Previous : Businessobjects in reportviewer.
Return to Discussion Forum
Post New Message
Category:

Related Messages
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.