学习笔记(1)

SQL Statement
1. Set Identity_Insert [Table_Name] [ON/OFF]
当表被设计为ID自动生成时,只有set 为ON, 才能手动插入指定ID值。
2. GO 语句:
(1)标注一批Transact-SQL 语句的结束
(2)在GO之前声明的变量在GO之后失效。

**************

1. 有namespace的XPath访问:
XmlNodeList nodeList;
XmlNode root
=doc.DocumentElement;
XmlNamespaceManager nspMgr
=new XmlNamespaceManager(doc.NameTable);
nspMgr.AddNamespace(
"nsp",doc.DocumentElement.NamespaceURI);
nodeList
=root.SelectNodes("//nsp:[@key]",nspMgr);

2. 取得当前Windows用户的权限:
string userName = WindowsIdentity.GetCurrent().Name;
WindowsPrincipal principal 
= new WindowsPrincipal(WindowsIdentity.GetCurrent());
bool isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator);
posted @ 2007-10-21 20:49  Stanley.Luo  阅读(178)  评论(0编辑  收藏  举报