<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet href="http://blog.itpub.net//styles/rss.css" type="text/css"?>

    <rss version="2.0" 
        xmlns:content="http://purl.org/rss/1.0/modules/content/"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
    ><channel>
<title>依风居</title>
<link>http://ebreezee.itpub.net</link>
<description></description>
<pubDate>Fri,21 11 2008 11:43:54</pubDate>
<generator>http://www.plogworld.net</generator>
<item>
<title>sql，去掉重复记录，去掉重复字段</title>
<description>select distinct 字段1，字段2 from table1 where...这样查询table1中字段1，字段2不重复的记录，注意的是distinct只能放在所有字段的最前面，不能select 字段1，distinct 字段2 from talbe1 where...。但如果是select distinct * from table1 where...这样只有有一个字段不同，就会分不同行的记录显示。</description>
<link>http://ebreezee.itpub.net/post/23931/471987</link>
<comments>http://ebreezee.itpub.net/post/23931/471987</comments>
<guid>http://ebreezee.itpub.net/post/23931/471987</guid>
<dc:creator>ebreezee</dc:creator>
<category>读书笔记</category>
<pubDate>Fri,10 10 2008 10:46:05</pubDate>
<source url="http://ebreezee.itpub.net/rss/rss20/23931">依风居</source>
</item>
<item>
<title>C#，取小数，不四舍五入</title>
<description>方法1：//更简单的方法见方法2int n=3；//例如取小数位3位double a=1.1234567；int index = a.ToString().IndexOf(&quot;.&quot;);//取小数点所在位置索引if (index + 1 + n &gt; a.ToString().Length|| a.ToString().IndexOf(&quot;.&quot;)==-1)//索引大于长度或a为整数string a3 = a.ToString();//a3以字符形式存放三位小数elsestring a3 = a.ToString().Substring(0, index + 1 + n);//取需要的长度方法2：double a=2.3456;a= Math.Floor(a* 1000) / 1000;//取三位小数,2.345double b=1;b= Math.Floor(b* 1000) / 1000;//1.0方法3：(int)(a*1000)/1000好像也可...</description>
<link>http://ebreezee.itpub.net/post/23931/470549</link>
<comments>http://ebreezee.itpub.net/post/23931/470549</comments>
<guid>http://ebreezee.itpub.net/post/23931/470549</guid>
<dc:creator>ebreezee</dc:creator>
<category>C＃</category>
<pubDate>Tue,09 09 2008 18:29:35</pubDate>
<source url="http://ebreezee.itpub.net/rss/rss20/23931">依风居</source>
</item>
<item>
<title>sql，截取字符串，取前几位</title>
<description>select substr(列名,0,3) From table1select To_Char(列名，'yyyyMMdd') From table1//如果是时间xxxx.toString(&quot;00000000&quot;);//object的toString有format的重载。如果是时间，需要转换成DateTime才能使用这样的方法。 </description>
<link>http://ebreezee.itpub.net/post/23931/470536</link>
<comments>http://ebreezee.itpub.net/post/23931/470536</comments>
<guid>http://ebreezee.itpub.net/post/23931/470536</guid>
<dc:creator>ebreezee</dc:creator>
<category>读书笔记</category>
<pubDate>Tue,09 09 2008 15:11:43</pubDate>
<source url="http://ebreezee.itpub.net/rss/rss20/23931">依风居</source>
</item>
<item>
<title>sql排序，指定记录行提前，字符型数字按数值型数字排序</title>
<description>Order By (Case Id When '28' Then 1 else 2 End ),Cast(Id As Int) Asc(Case Id When '28' Then 1 else 2 End ) 是指定Id号为‘28’的记录显示在最前面；Cast(Id As Int) Asc 是将字符型的Id列按数字排序。</description>
<link>http://ebreezee.itpub.net/post/23931/470177</link>
<comments>http://ebreezee.itpub.net/post/23931/470177</comments>
<guid>http://ebreezee.itpub.net/post/23931/470177</guid>
<dc:creator>ebreezee</dc:creator>
<category>读书笔记</category>
<pubDate>Thu,04 09 2008 19:55:38</pubDate>
<source url="http://ebreezee.itpub.net/rss/rss20/23931">依风居</source>
</item>
<item>
<title>使dateTimePicker的值为当前时间或当天时间</title>
<description>初始化窗体时，加入：this.dateTimePicker1.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);//当前时间this.dateTimePicker1.Value = DateTime.Now.Date;//当天时间 </description>
<link>http://ebreezee.itpub.net/post/23931/469287</link>
<comments>http://ebreezee.itpub.net/post/23931/469287</comments>
<guid>http://ebreezee.itpub.net/post/23931/469287</guid>
<dc:creator>ebreezee</dc:creator>
<category>C＃</category>
<pubDate>Sat,23 08 2008 17:37:25</pubDate>
<source url="http://ebreezee.itpub.net/rss/rss20/23931">依风居</source>
</item>
<item>
<title>在sql语句中需要用到另外一个表table的值</title>
<description>(Select column1 From table1 Where rowNum=1 And...)可以当作一个值来嵌套到其他sql语句当中。rowNum=1表示如果有多行只选择一行，即一个值。</description>
<link>http://ebreezee.itpub.net/post/23931/469286</link>
<comments>http://ebreezee.itpub.net/post/23931/469286</comments>
<guid>http://ebreezee.itpub.net/post/23931/469286</guid>
<dc:creator>ebreezee</dc:creator>
<category>读书笔记</category>
<pubDate>Sat,23 08 2008 17:31:57</pubDate>
<source url="http://ebreezee.itpub.net/rss/rss20/23931">依风居</source>
</item>
<item>
<title>一表table某几列数据插入另外一个表table</title>
<description>Insert Into table1 (column1,column2) Select column1,column2 From table2 </description>
<link>http://ebreezee.itpub.net/post/23931/469285</link>
<comments>http://ebreezee.itpub.net/post/23931/469285</comments>
<guid>http://ebreezee.itpub.net/post/23931/469285</guid>
<dc:creator>ebreezee</dc:creator>
<category>读书笔记</category>
<pubDate>Sat,23 08 2008 17:20:17</pubDate>
<source url="http://ebreezee.itpub.net/rss/rss20/23931">依风居</source>
</item>
<item>
<title>C#,求幂，N次方</title>
<description>Math.Pow(底数，幂指数)，幂指数可为负。</description>
<link>http://ebreezee.itpub.net/post/23931/469283</link>
<comments>http://ebreezee.itpub.net/post/23931/469283</comments>
<guid>http://ebreezee.itpub.net/post/23931/469283</guid>
<dc:creator>ebreezee</dc:creator>
<category>C＃</category>
<pubDate>Sat,23 08 2008 15:52:29</pubDate>
<source url="http://ebreezee.itpub.net/rss/rss20/23931">依风居</source>
</item>
<item>
<title>sql，两表或多表某列数值相加或相减，可用于库存计算</title>
<description>--如果是减去某表该列则在列名前面加上&quot;-&quot;号就可以了--下面a,b,c都为列名，table1,table2,table3为表名Select Sum(a) a, b,c From(Select a,b,c From table1 Where b=1 Union Select -a,b,c From table2 Union Select a,b,c From table3) total Group by a,b,c Order by b,c</description>
<link>http://ebreezee.itpub.net/post/23931/469112</link>
<comments>http://ebreezee.itpub.net/post/23931/469112</comments>
<guid>http://ebreezee.itpub.net/post/23931/469112</guid>
<dc:creator>ebreezee</dc:creator>
<category>读书笔记</category>
<pubDate>Wed,20 08 2008 18:54:23</pubDate>
<source url="http://ebreezee.itpub.net/rss/rss20/23931">依风居</source>
</item>
<item>
<title>删除datatable的行后，出现“不能通过已删除的行访问该行的信息”的错误</title>
<description>采用datatable.Rows[i].Delete()删除行后再访问该表时出现出现“不能通过已删除的行访问该行的信息”的错误。原因如下：Delete()之后需要datatable.AccepteChanges()方法确认完全删除，因为Delete()只是将相应列的状态标志为删除，还可以通过datatable.RejectChanges()回滚，使该行取消删除。所以如果要彻底删除datarow，需要Delete()和AccepteChanges()方法同时使用，或者采用datatable.Rows.RemoveAt(i)方法直接删除，其中i表示行索引，还有一个就是datatable.Rows.Remove(DataRow dr)删除指定行。不过使用datatable.Rows.RemoveAt(i)要...</description>
<link>http://ebreezee.itpub.net/post/23931/469110</link>
<comments>http://ebreezee.itpub.net/post/23931/469110</comments>
<guid>http://ebreezee.itpub.net/post/23931/469110</guid>
<dc:creator>ebreezee</dc:creator>
<category>C＃</category>
<pubDate>Wed,20 08 2008 17:26:38</pubDate>
<source url="http://ebreezee.itpub.net/rss/rss20/23931">依风居</source>
</item>
   </channel>
</rss>



