Don't do things like that!
The problem is that you don't control the execution order: the compiler (and worse the optimiser) is at liberty to evaluate the "elements" of that string in any order it chooses - and it doesn't know that the Read method needs to be called first.
Try explicitly ordering the operations:
rdr = scomm.ExecuteReader();
bool isData = rdr.Read();
string s1 = rdr.GetString(0);
string s2 = String.ReferenceEquals(rdr.GetString(0), "SUCCES");
log.Debug("log 1" + isData + " " + s1 + " " + s2);
As to why they aren't the same reference, the intern pool for strings is only applied to string literals - not to strings that aren't defined at compile time. Try this:
private string GC(string s1, string s2)
{
return s1 + s2;
}
...
string s1 = GC("hello", " there");
string s2 = GC("hello", " there");
string s3 = "hello there";
string s4 = "hello there";
Console.WriteLine("{0}:{1}", s1 == s2, string.ReferenceEquals(s1, s2));
Console.WriteLine("{0}:{1}", s1 == s3, string.ReferenceEquals(s1, s3));
Console.WriteLine("{0}:{1}", s3 == s4, string.ReferenceEquals(s3, s4));
And you will get:
True:False
True:False
True:True