05 2011 档案

摘要:这是我写的第一个Linq 语句。写的比较慢。因为经常写sql现在写Linq总是感觉不顺手。不说了,下面就是我的一个Linq语句。获得每组的记录数:varb=fromainList1letpcount=List2.Where(s=>s.CenterId==a.CenterId).Count()wherea.CenterId!=0selectnew{groupID=1,CenterID=a.CenterId,lal=a.Latitude,lo=a.Longitude,isHave=a.HasData,countC=pcount};获取组中记录最大的varc=fromdinbgroupdbyd 阅读全文
posted @ 2011-05-30 12:53 空紫竹 阅读(550) 评论(0) 推荐(0)
摘要:createtable#Temp(DatabaseNamevarchar(200),bigfloat,typeint)declare@sqlvarchar(1000),@iint,@Namevarchar(200)set@sql='INSERTINTO#TempSELECTname,size*8.0/1024,typeFROM'set@sql=@sql+'[?].sys.database_files'EXECUTEsp_msforeachdb@sqlselect'Datafile'asFType,(selectsum(big)from#Tempw 阅读全文
posted @ 2011-05-19 10:44 空紫竹 阅读(325) 评论(0) 推荐(0)
摘要:1.触发器方法createTriggerTrigger_NameonTable1afterdelete,UPDATEasbeginsetnocounton;ifexists(select*frominserted)updateTable2setfield1=(selectfield1frominserted)wherefield1=(selectfield1frominserted)elsedeletefromTable2wherefield1=(selectfield1fromdeleted)setnocountoff;end 2. 创建外键关联关系ALTERTABLEtable1ADDCO 阅读全文
posted @ 2011-05-17 09:20 空紫竹 阅读(3853) 评论(0) 推荐(0)
摘要:// get focus inside the Silverlight plugin System.Windows.Browser.HtmlPage.Plugin.Invoke("focus"); // queue this call to occur after the plugin focus Dispatcher.BeginInvoke(delegate() { this.TestID.Focus(); }); 阅读全文
posted @ 2011-05-12 17:07 空紫竹 阅读(341) 评论(0) 推荐(0)
摘要:Silverlight 中的RichTextBox 的Hyperlink设置 IsReadOnly="True"时 Hyperlink可以使用。 阅读全文
posted @ 2011-05-11 10:18 空紫竹 阅读(215) 评论(0) 推荐(0)
摘要:publicstaticvoidSetCookie(Stringkey,Stringvalue,TimeSpan?expires){StringBuildercookie=newStringBuilder();cookie.Append(String.Concat(key,"=",value));if(expires.HasValue){DateTimeexpire=DateTime.UtcNow+expires.Value;cookie.Append(String.Concat(";expires=",expire.ToString("R&q 阅读全文
posted @ 2011-05-09 17:26 空紫竹 阅读(319) 评论(2) 推荐(0)
摘要:前几天我的vs2010突然不能调试了。后来找了很多的解决方案都不能解决问题。1. 删除所有的bin, debug2. 重建工程。3. 重新安装Silverlight的开发包。还是不行。最后是删除了C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files下面的所有临时文件。重新打开vs2010终于可以调试了。这个问题折腾了半天的时间。 阅读全文
posted @ 2011-05-03 12:45 空紫竹 阅读(13517) 评论(0) 推荐(0)