Hi All,
Could some one explain me the difference between the 2 lines below.
string sql = @"SELECT columnname " +
@"FROM tablename " +
@"WHERE ID = '" + settingId + "' ";
string sql = "SELECT columnname " +
"FROM tablename " +
"WHERE ID = '" + settingId + "' ";
Does '@' in the first statement makes any difference?
Loading
Niradhip ChakrabortyPosted Jun 4, 2009, 4:39 PM
The @ symbol tells the string constructor to ignore escape characters and line breaks. The following two strings are therefore identical:
string p1 = "\\\\My Documents\\My Files\\";
string p2 = @"\\My Documents\My Files\";
Kirtan PatelPosted Jun 3, 2009, 10:41 PM
if there is ' / ' then you should use @ before string
other wise not