智能替换DataTable.Select中会导致错误的单引号
摘要:看到§猪阿不猪§提到一个DataTable.Select的注意事项: 注意去掉不正确的单引号.平时项目中,我们一般是直接在写filter语句时这样写theName = theName.Replace("'","''");string filter = string.Format("Name = '{0}'", theName);不过有时候也比较麻烦, 如果你的filter里面c...
阅读全文
Nullable Type is an immutable type
摘要:Consider this following code in C# 2.0 int? i = 1; i++; Console.WriteLine(i); int? j = i; j = null; Console.WriteLine(j.HasValue);in...
阅读全文
Why does Dataset NOT serialize its BinaryFormat property? (ADO.net 2.0)
摘要:I have tested the dataset new "binary serialize" feature in ADO.Net 2.0. Many articals said if we set the dataset's property "RemotingFormat" as "SerializationFormat.Binary", it can serialize i...
阅读全文
Undocumented Keywords in C#
摘要:研究Int32&的时候,无意中发现C#里面还有4个Undocument Keyword, 分别是__makeref, __reftype, __refvalue 以及__arglist。 其中前三个keyword可以这样用: int i = 1; TypedReference tr = __makeref(i); Type t = __...
阅读全文
System.Int32&是个啥?
摘要:在.Net中存在不从Object继承的类吗?
阅读全文