Only 1
From here, the IL autmatically concatenate those string constants.
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
// Code size 8 (0x8)
.maxstack 1
.locals init ([0] string query)
IL_0000: nop
IL_0001: ldstr "SELECT * FROM Table1 A INNER JOIN Table2 B ON A.ID"
+ " = B.ID WHERE A.Name = 'jokiz'"
IL_0006: stloc.0
IL_0007: ret
} // end of method Program::Main
However for this statement it will be different,
int x = 25;
string query = "SELECT * FROM Table1 A " + x.ToString() +
"INNER JOIN Table2 B ON A.ID = B.ID " +
"WHERE A.Name = 'jokiz'";
IL_0003: stloc.0
IL_0004: ldstr "SELECT * FROM Table1 A "
IL_0009: ldloca.s x
IL_000b: call instance string [mscorlib]System.Int32::ToString()
IL_0010: ldstr "INNER JOIN Table2 B ON A.ID = B.ID WHERE A.Name = "
+ "'jokiz'"
IL_0015: call string [mscorlib]System.String::Concat(string,
string,
string)
thanks pare! 5start for u!
Rodel E. Dagumampan
Software Engineer - ASP.NET/C#
Bel-air, Makati, Philippines
