摘要:单个form子句string[] values = { "LINQ学习", "LINQ基本语句", "from子句", "单个from子句" }; var value = from v in values where v.IndexOf("LINQ") > -1 //包含字符串 select new
阅读全文
摘要:SQLite中的时间日期函数这是我学习SQLite时做的笔记,参考并翻译了Chris Newman写的《SQLite》中的《Working with Dates and Times》部分内容。SQLite包含了如下时间/日期函数:datetime().......................产生
阅读全文
摘要:cx = sqlite3.connect("c:/数据库地址") # 打开数据库cu = cx.cursor()# delete the rowcu.execute("delete from user where username=='majuan'")# Save (commit) the cha
阅读全文
摘要:cx = sqlite3.connect("c:/数据库地址") # 打开数据库cu = cx.cursor()# query the tablerows = cu.execute("select * from user")# print the tablefor row in rows: prin
阅读全文
摘要:删除节点 XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(xmlPath); var root = xmlDoc.DocumentElement;//取到根结点 var element = xmlDoc.SelectSingleNode("Bo
阅读全文
摘要:避免在索引列上使用计算 where子句中,如果索引列是函数的一部分,优化器将不使用索引而使用全表扫描。例如: (低效)select ... from [dept] where [sal]*12>25000; (高效)select ... from [dept] where [sal]>25000/1
阅读全文