??xml version="1.0" encoding="utf-8" standalone="yes"?>人人鲁人人莫人人爱精品,国产精品一区二区免费看,亚洲在线免费http://www.aygfsteel.com/kiant/category/36893.html有才而性缓定属大才Q有气和斯为大智。h偏狭我受之以宽容Qh险仄我持之以坦荡。缓事宜急干Q敏则有功;急事宜缓办,忙则多措? --李叔?/description>zh-cnThu, 29 Apr 2010 20:18:52 GMTThu, 29 Apr 2010 20:18:52 GMT60[转] DataBinder.Eval用法http://www.aygfsteel.com/kiant/articles/319195.html黄小?/dc:creator>黄小?/author>Tue, 27 Apr 2010 05:15:00 GMThttp://www.aygfsteel.com/kiant/articles/319195.htmlhttp://www.aygfsteel.com/kiant/comments/319195.htmlhttp://www.aygfsteel.com/kiant/articles/319195.html#Feedback0http://www.aygfsteel.com/kiant/comments/commentRss/319195.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/319195.html 转自Q?br /> [ASP.NET]DataBinder.Eval用法
http://www.cnblogs.com/march3/archive/2007/05/22/755534.html

 

<%# Bind("Subject") %> //l定字段
<%# Container.DataItemIndex + 1%> //实现自动~号
<%# DataBinder.Eval(Container.DataItem, "[n]") %>

通常使用的方?br /> <%# DataBinder.Eval(Container.DataItem, "ColumnName") %>
<%# DataBinder.Eval(Container.DataItem, "ColumnName", null) %>
<%# DataBinder.Eval(Container, "DataItem.ColumnName", null) %>

其他用法
<%# ((DataRowView)Container.DataItem)["ColumnName"] %>
<%# ((DataRowView)Container.DataItem).Row["ColumnName"] %>
<%# ((DataRowView)Container.DataItem)["adtitle"] %>
<%# ((DataRowView)Container.DataItem)[n] %>
<%# ((DbDataRecord)Container.DataItem)[0] %>
<%# (((自定义类?Container.DataItem)).属?ToString() %>//如果属性ؓ(f)字符串类型就不用ToString()?/p>

DataBinder.Eval用法范例
<%# DataBinder.Eval(Container.DataItem, "IntegerValue", "{0:c}") %>
格式化字W串参数是可选的。如果忽略参敎ͼDataBinder.Eval q回对象cd的|

//昄二位数
<%# DataBinder.Eval(Container.DataItem, "UnitPrice", "${0:F2}") %>
//{0:G}代表昄True或False
<ItemTemplate>
 <asp:Image Width="12" Height="12" Border="0" runat="server"
 AlternateText='<%# DataBinder.Eval(Container.DataItem, "Discontinued", "{0:G}") %>'
 ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Discontinued", "~/images/{0:G}.gif") %>' />
</ItemTemplate>
//转换cd
((string)DataBinder.Eval(Container, "DataItem.P_SHIP_TIME_SBM8")).Substring(4,4)
{0:d} 日期只显C年月日
{0:yyyy-mm-dd} 按格式显C年月日
{0:c} 货币样式
<%#Container.DataItem("price","{0:K?,##0.00}")%>
<%# DataBinder.Eval(Container.DataItem,"Company_Ureg_Date","{0:yyyy-M-d}")%>


Specifier Type     Format   Output (Passed Double 1.42)  Output (Passed Int -12400)
c  Currency        {0:c}     $1.42     -$12,400
d  Decimal         {0:d}    System.FormatException  -12400
e  Scientific      {0:e}    1.420000e+000    -1.240000e+004
f  Fixed point     {0:f}  1.42    -12400.00
g  General         {0:g}  1.42     -12400
n  Number with commas for thousands  {0:n}  1.42     -12,400
r  Round trippable    {0:r}  1.42     System.FormatException
x  Hexadecimal    {0:x4}  System.FormatException   cf90


{0:d} 日期只显C年月日
{0:yyyy-mm-dd} 按格式显C年月日


样式取决?Web.config 中的讄

{0:c}  ?{0:K?,000.00} 货币样式  标准英国货币样式
<system.web>
      <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US" />
</system.web>
昄?K?,000.10

{0:c}  ?string.Format("{0:C}", price); 中国货币样式
<system.web>
      <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="zh-cn" uiCulture="zh-cn" />
</system.web>
昄?K?,000.10

{0:c}  ?string.Format("{0:C}", price); 国货币样式
<system.web>
      <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
昄?$3,000.10

 

DataBinder.Eval(Container.DataItem,"Name")和Container.DataItem("Name")有什么区别?
DataBinder是System.Web里面的一个静态类Q它提供?span style="color: #0000ff">EvalҎ(gu)用于化数据绑定表辑ּ的编?/span>Q但是它使用的方式是通过Reflection{开销比较大的Ҏ(gu)来达到易用性,因此其性能q不是最好的。而Container则根本不是Q何一个静态的对象或方法,它是ASP.NET面~译器在数据l定事g处理E序内部声明的局部变量,其类型是可以q行数据l定的控件的数据容器cdQ如在Repeater内部的数据绑定容器叫RepeaterItemQ,在这些容器类中基本都有DataItem属性,因此你可以写C(j)ontainer.DataItemQ这个属性返回的是你正在被绑定的数据源中的那个数据项。如果你的数据源是DataTableQ则q个数据的cd实际是DataRowView?br />



数据l定以及(qing)Container.DataItem几种方式与用法分?/strong>
http://blog.csdn.net/jelink/archive/2006/08/25/1118839.aspx

 

l定到集?<asp:ListBox id="ListBox1" datasource='<%# myArray%>' runat="server">

<%@ Import namespace="System.Data" %> 
<%# ((DataRowView)Container.DataItem)["xxxx"]%> 




What's the deal with Databinder.Eval and Container.DataItem?
http://weblogs.asp.net/rajbk/archive/2004/07/20/what-s-the-deal-with-databinder-eval-and-container-dataitem.aspx

 

<href='<%#  Databinder.Eval(Container.DataItem,"ID","default.aspx?CategoryId={0}" ) %>'>


re: What's the deal with Databinder.Eval and Container.DataItem? 

Answering the question.

<%If DataBinder.Eval(Container.DataItem, "DATAFIELD"<> "" Then

   Response.Write(
"something")

End If %>

Try this.

<%# DataBinder.Eval(Container.DataItem, "DataField").Equals("")?"":"Something"%>


Thursday, August 02, 2007 11:23 PM by someone 




]]>
[转]Response.Redirect(),Server.Transfer(),Server.Execute()的区?/title><link>http://www.aygfsteel.com/kiant/articles/319194.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Fri, 23 Apr 2010 05:56:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/319194.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/319194.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/319194.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/319194.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/319194.html</trackback:ping><description><![CDATA[<br /> 内容转自Q?br /> Response.Redirect(),Server.Transfer(),Server.Execute()的区?br /> http://www.cnblogs.com/3stones/archive/2008/03/20/1114645.html<br /> <br /> <br /> <p><strong>1、Response.Redirect():</strong><br />       Response.RedirectҎ(gu)D览器链接到一个指定的URL。当Response.Redirect()Ҏ(gu)被调用时Q它?x)创Z个应{,应答头中指出了状态代?02Q表C目标已l改变)以及(qing)新的目标URL。浏览器从服务器收到该应{,利用应答头中的信息发Z个对新URL的请求?br />   <br />       q就是说Q用Response.RedirectҎ(gu)旉定向操作发生在客L(fng)Q?span style="color: #0000ff">d涉及(qing)Cơ与服务器的通信Q两个来回)Q?/span>W一ơ是对原始页面的hQ得C?02应答Q第二次是请?02应答中声明的新页面,得到重定向之后的面?br /> </p> <p><strong>2、Server.Transfer</strong>    <br />       Server.transfer是IIS 5.0新增加的一个功能。它解决了Response.Redirect的两个重要的~陷Q?br />       1Q在Response.Redirect中,我们得不CQ何第一늚输出<br />       2QResponse.Redirect?x)丢失request中的所有属性,当然我们可以通过一些其他的办法Q比如session来搞定,可是Q有些页的参数是在request中传q来的,q样的话Q就不行?br />      3)  Response.Redirect需要client端再发v一个请求?br /> <br />       Server.transfer很好地解决了这些问题。它是从server端直接向下一发赯求,不需要client再次发送请求。如果你的网非怾赖response.redirectQ这个小的改变可以提高近25%的效率(Ҏ(gu)微Y文档Q?/p> <p>      Server.TransferҎ(gu)<span style="color: #0000ff">把执行流E从当前的ASPX文g转到同一服务器上的另一个ASPX面</span>。调用Server.TransferӞ当前的ASPX面l止执行Q执行流E{入另一个ASPX面Q但新的ASPX面仍用前一ASPX面创徏的应{流?br />   <br />       如果用Server.TransferҎ(gu)实现面之间的导航,<span style="color: #0000ff">览器中的URL不会(x)改变</span>Q因为重定向完全在服务器端进行,览器根本不知道服务器已l执行了一ơ页面变换?br />   <br />       默认情况下,Server.TransferҎ(gu)不会(x)把表单数据或查询字符串从一个页面传递到另一个页面,但只要把该方法的W二个参数设|成TrueQ就<span style="color: #0000ff">可以保留W一个页面的表单数据和查询字W串</span>?br />   <br />       同时Q用Server.Transfer时应<span style="color: #ff0000">注意一?/span>Q目标页面将使用原始面创徏的应{流Q这DASP.NET的机器验证检查(Machine Authentication CheckQMACQ认为新面的ViewState已被改。因此,如果要保留原始页面的表单数据和查询字W串集合Q必L目标面Page指o(h)?EnableViewStateMac属性设|成False?/p> <p>      Server.Transfer()有一?span style="color: #ff0000">不是Q?/span>当用户在a.aspx中提交了一个表?然后用Server.Transfer()q入 b.aspxQ这时如果用户刷C下页面,览器便?x)问用户是?#8220;重试”发送表单,如果用户点击“?#8221;Q那么,表单中的数据被重新发送到服务器。如发送表单的作用是Z向数据库中插入一条记录,l果g希望发生的事——同一表单被多ơ加入到数据库中?/p> <p><br /> <br /> <strong>3、Server.Execute</strong>  <br />       Server.ExecuteҎ(gu)允许<span style="color: #0000ff">当前的ASPX面执行一个同一Web服务器上的指定ASPX面</span>Q当指定的ASPX面执行完毕Q控制流E重新返回原面发出Server.Execute调用的位|。这U页面导航方式类g针对ASPX面的一ơ函数调用,<span style="color: #ff0000">被调用的面能够讉K发出调用面的表单数据和查询字符串集?/span>Q所以要把被调用面Page指o(h)的EnableViewStateMac属性设|成False?br /> <br /> </p> <p><strong>4.</strong><br /> Server.Execute("another.aspx")和Server.Transfer("another.aspx")区别:  <br /> Execute是从当前面转移到指定页?q将执行q回到当前页?nbsp; <br /> Transfer是将执行完全转移到指定页?</p> <p><br /> <strong>ȝQ?br /> </strong>在网l状态较好的情况?Redirect(url)Ҏ(gu)效率最?! 可重定向到同一台或非同一台服务器上的aspx或非aspxQhtmlQ资?nbsp;  <span style="color: #0000ff"> *重定?br /> </span>Server.TransferҎ(gu)和Server.ExecuteҎ(gu)最灉|!! 但只能{到同一Application目录下,也有可能D不期望的l果发生    <span style="color: #0000ff">*转发<br /> </span>Server.ExecuteҎ(gu)占用资源最?     <span style="color: #0000ff">*包含<br /> </span><br /> <font color="#0000ff">ps. *ؓ(f)W记</font></p> <img src ="http://www.aygfsteel.com/kiant/aggbug/319194.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2010-04-23 13:56 <a href="http://www.aygfsteel.com/kiant/articles/319194.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DataTable、DataView、ListBox 数据l定与查?/title><link>http://www.aygfsteel.com/kiant/articles/280746.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Thu, 22 Apr 2010 04:35:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/280746.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/280746.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/280746.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/280746.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/280746.html</trackback:ping><description><![CDATA[<br /> <a target="_blank">DataTable的一些特D用法:(x)Select</a> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Codehighlighter1_0_36_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_36_Open_Text.style.display='none'; Codehighlighter1_0_36_Closed_Image.style.display='inline'; Codehighlighter1_0_36_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_0_36_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_0_36_Closed_Text.style.display='none'; Codehighlighter1_0_36_Open_Image.style.display='inline'; Codehighlighter1_0_36_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span id="Codehighlighter1_0_36_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_0_36_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000"> <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />* 补充一下,q可以利用DataView来达到检索的目的?nbsp;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /></span><span style="color: #008000">*/</span></span><span style="color: #000000"> <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />DataTable dataSource </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> DataTable(); <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />DataView dv </span><span style="color: #000000">=</span><span style="color: #000000"> dataSource.DefaultView; <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />dv.RowFilter </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">columnA = 'abc'</span><span style="color: #000000">"</span><span style="color: #000000">; <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #008000">//</span><span style="color: #008000">1.qo(h)后直接获取DataTable </span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #000000">DataTable newTable1 </span><span style="color: #000000">=</span><span style="color: #000000"> dv.ToTable(); <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #008000">//</span><span style="color: #008000">2.讄新DataTable的TableName </span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #000000">DataTable newTable2 </span><span style="color: #000000">=</span><span style="color: #000000"> dv.ToTable(</span><span style="color: #000000">"</span><span style="color: #000000">NewTableName</span><span style="color: #000000">"</span><span style="color: #000000">); <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #008000">//</span><span style="color: #008000">3.讄新表是否qo(h)重复?拥有的列的列名以?qing)出现的?nbsp;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #008000">//</span><span style="color: #008000">卛_以设|新表的字段。但是字D名肯定是老表dataSource中拥有的?nbsp;</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #000000">DataTable newTable3 </span><span style="color: #000000">=</span><span style="color: #000000"> <br /> <img id="Codehighlighter1_417_445_Open_Image" onclick="this.style.display='none'; Codehighlighter1_417_445_Open_Text.style.display='none'; Codehighlighter1_417_445_Closed_Image.style.display='inline'; Codehighlighter1_417_445_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_417_445_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_417_445_Closed_Text.style.display='none'; Codehighlighter1_417_445_Open_Image.style.display='inline'; Codehighlighter1_417_445_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />dv.ToTable(</span><span style="color: #0000ff">true</span><span style="color: #000000">, </span><span style="color: #0000ff">new</span><span style="color: #000000"> </span><span style="color: #0000ff">string</span><span style="color: #000000">[] </span><span id="Codehighlighter1_417_445_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_417_445_Open_Text"><span style="color: #000000">{ </span><span style="color: #000000">"</span><span style="color: #000000">columnA,columnF,columnC</span><span style="color: #000000">"</span><span style="color: #000000"> }</span></span><span style="color: #000000">); <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #008000">//</span><span style="color: #008000">4.l合?.3两点?nbsp;</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #000000">DataTable newTable4 </span><span style="color: #000000">=</span><span style="color: #000000"> <br /> <img id="Codehighlighter1_534_562_Open_Image" onclick="this.style.display='none'; Codehighlighter1_534_562_Open_Text.style.display='none'; Codehighlighter1_534_562_Closed_Image.style.display='inline'; Codehighlighter1_534_562_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_534_562_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_534_562_Closed_Text.style.display='none'; Codehighlighter1_534_562_Open_Image.style.display='inline'; Codehighlighter1_534_562_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />dv.ToTable(</span><span style="color: #000000">"</span><span style="color: #000000">NewTableName</span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #0000ff">true</span><span style="color: #000000">, </span><span style="color: #0000ff">new</span><span style="color: #000000"> </span><span style="color: #0000ff">string</span><span style="color: #000000">[] </span><span id="Codehighlighter1_534_562_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_534_562_Open_Text"><span style="color: #000000">{ </span><span style="color: #000000">"</span><span style="color: #000000">columnA,columnF,columnC</span><span style="color: #000000">"</span><span style="color: #000000"> }</span></span><span style="color: #000000">);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span></div> 化,利用 DataViewqo(h) <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />                <span style="color: #000000">DataView dv </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.dtPerson.DefaultView;            </span><span style="color: #008000">//</span><span style="color: #008000">讄一个视图过?/span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #000000">                dv.RowFilter </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">employee_dept_id = </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> departId;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff">this</span><span style="color: #000000">.lstSource.DataSource </span><span style="color: #000000">=</span><span style="color: #000000"> dv;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff">this</span><span style="color: #000000">.lstSource.DisplayMember </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">employee_name</span><span style="color: #000000">"</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />                </span><span style="color: #0000ff">this</span><span style="color: #000000">.lstSource.ValueMember </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">id</span><span style="color: #000000">"</span><span style="color: #000000">;<br /> <br />                     <span style="color: #0000ff">this</span>.dvPendingNode.RowFilter = "(node_end_time is null or node_end_time > '2009-6-10 17:55:13')";<br />                     <span style="color: #0000ff">this</span>.dvPendingNode.RowFilter += "and  degree_name in ('', 'q行', '暂停', '搁置') ";</span></div> <br /> <br /> <br /> <hr color="#999999" size="4" /> <strong>1. 我在一个winformE序里用DataView的RowFilter{选时用两个下划线代表两个字符Q但是怎么{选不出来?</strong><br /> http://topic.csdn.net/t/20040814/04/3273316.html<br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #000000">Q:<br /> 我在一个winformE序里用DataView的RowFilter{选时用两个下划线代表两个个字W,如:(x)   <br />   dv.RowFilter="PID   LIKE   '"+str+"-__"Q这L(fng){选语句在SQL企业理器里执行是能正确{选到记录的,但是Z么在q里׃个都{选不出来Q是不是q里要用别的W号来代表一个字W啊?nbsp;<br /> <br /> A:<br /> "_"   is   probably   very   sql   server   specific,   classes   in   System.Data   is   supposed   to   be   DBMS   independent,   you   can   try   to   use   <br />     <br />   ABC   LIKE   'abc*'   AND   LEN(ABC)=5<br /> <br /> </span></div> <br /> <br /> <br /> <br /> <br /> <hr color="#999999" size="4" /> <strong>2. ListBox 多项选择QDataRowViewQ?/strong> <br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">for</span><span style="color: #000000"> (</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.lstSource.SelectedItems.Count; i</span><span style="color: #000000">++</span><span style="color: #000000">)<br /> <img id="Codehighlighter1_73_515_Open_Image" onclick="this.style.display='none'; Codehighlighter1_73_515_Open_Text.style.display='none'; Codehighlighter1_73_515_Closed_Image.style.display='inline'; Codehighlighter1_73_515_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_73_515_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_73_515_Closed_Text.style.display='none'; Codehighlighter1_73_515_Open_Image.style.display='inline'; Codehighlighter1_73_515_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />            </span><span id="Codehighlighter1_73_515_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_73_515_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                DataRowView row </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.lstSource.SelectedItems[i] </span><span style="color: #0000ff">as</span><span style="color: #000000"> DataRowView;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #0000ff">int</span><span style="color: #000000"> id </span><span style="color: #000000">=</span><span style="color: #000000"> Int32.Parse(row[</span><span style="color: #000000">"</span><span style="color: #000000">id</span><span style="color: #000000">"</span><span style="color: #000000">].ToString());<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #0000ff">string</span><span style="color: #000000"> employee </span><span style="color: #000000">=</span><span style="color: #000000"> String.Format(</span><span style="color: #000000">"</span><span style="color: #000000">{0}<{1}></span><span style="color: #000000">"</span><span style="color: #000000">, row[</span><span style="color: #000000">"</span><span style="color: #000000">employee_name</span><span style="color: #000000">"</span><span style="color: #000000">], row[</span><span style="color: #000000">"</span><span style="color: #000000">dept_name</span><span style="color: #000000">"</span><span style="color: #000000">]);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #008000">//</span><span style="color: #008000">数据填充</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">                </span><span style="color: #0000ff">if</span><span style="color: #000000"> (</span><span style="color: #000000">!</span><span style="color: #0000ff">this</span><span style="color: #000000">.idList.Contains(id))<br /> <img id="Codehighlighter1_405_514_Open_Image" onclick="this.style.display='none'; Codehighlighter1_405_514_Open_Text.style.display='none'; Codehighlighter1_405_514_Closed_Image.style.display='inline'; Codehighlighter1_405_514_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_405_514_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_405_514_Closed_Text.style.display='none'; Codehighlighter1_405_514_Open_Image.style.display='inline'; Codehighlighter1_405_514_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                </span><span id="Codehighlighter1_405_514_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_405_514_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                    </span><span style="color: #0000ff">this</span><span style="color: #000000">.idList.Add(id);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                    </span><span style="color: #0000ff">this</span><span style="color: #000000">.valueList.Add(employee);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />                }</span></span></div> </span> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />             <span style="color: #000000">System.Windows.Forms.ListBox.SelectedIndexCollection indexes </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.lstTarget.SelectedIndices;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: #0000ff">for</span><span style="color: #000000"> (</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> indexes.Count </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">; i </span><span style="color: #000000">>=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i</span><span style="color: #000000">--</span><span style="color: #000000">)<br /> <img id="Codehighlighter1_181_298_Open_Image" onclick="this.style.display='none'; Codehighlighter1_181_298_Open_Text.style.display='none'; Codehighlighter1_181_298_Closed_Image.style.display='inline'; Codehighlighter1_181_298_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_181_298_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_181_298_Closed_Text.style.display='none'; Codehighlighter1_181_298_Open_Image.style.display='inline'; Codehighlighter1_181_298_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />            </span><span id="Codehighlighter1_181_298_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_181_298_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #0000ff">this</span><span style="color: #000000">.idList.RemoveAt(indexes[i]);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #0000ff">this</span><span style="color: #000000">.valueList.RemoveAt(indexes[i]);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />            }</span></span></div> <img src ="http://www.aygfsteel.com/kiant/aggbug/280746.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2010-04-22 12:35 <a href="http://www.aygfsteel.com/kiant/articles/280746.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Enterprise Library 4 ?DAAB使用http://www.aygfsteel.com/kiant/articles/317510.html黄小?/dc:creator>黄小?/author>Mon, 05 Apr 2010 14:26:00 GMThttp://www.aygfsteel.com/kiant/articles/317510.htmlhttp://www.aygfsteel.com/kiant/comments/317510.htmlhttp://www.aygfsteel.com/kiant/articles/317510.html#Feedback0http://www.aygfsteel.com/kiant/comments/commentRss/317510.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/317510.html 引用自:(x)
Enterprise Library 2.0 -- Data Access Application Block 和 加密数据库连接字W串
http://www.cnblogs.com/adamoooo/articles/892618.html



取得存储q程的返回倹{输出参?br />
 带输出参数的Q?/strong>
            try
            {
                Database db 
= DatabaseFactory.CreateDatabase();
                DbCommand cmd 
= db.GetStoredProcCommand("usp_xxx");

                db.AddParameter(cmd, 
"@UserID", DbType.Int32, ParameterDirection.InputOutput, "", DataRowVersion.Current, dict.Get("UserID"0));
                db.AddInParameter(cmd, 
"@LoginName", DbType.String, dict["LoginName"]);
                

                db.ExecuteNonQuery(cmd);
                
return DictionaryEx.Create("UserID", db.GetParameterValue(cmd, "@UserID"));
            }
            
catch (Exception)
            {
                
return null;
            }        



带返回|(x)
try
            {
                Database db 
= DatabaseFactory.CreateDatabase();
                DbCommand cmd 
= db.GetStoredProcCommand("usp_xxx");
                db.AddInParameter(cmd, 
"@UserID", DbType.Int32, dict["UserID"]);
                
                db.AddParameter(cmd, 
"@ret", DbType.Int32, ParameterDirection.ReturnValue, "", DataRowVersion.Default, null);
                db.ExecuteNonQuery(cmd);

                
return cmd.Parameters["@ret"].Value;
            }
            
catch (Exception)
            {
                
return null;
            }



查询q回l果集:(x)
try
            {
                Database db 
= DatabaseFactory.CreateDatabase();
                DbCommand cmd 
= db.GetStoredProcCommand("usp_xxx");
                db.AddInParameter(cmd, 
"@rowStart", DbType.Int32, dict.Get("rowStart"null));
                db.AddInParameter(cmd, 
"@rowEnd", DbType.Int32, dict.Get("rowEnd"null));

                
return db.ExecuteDataSet(cmd);
            }
            
catch (Exception)
            {
                
return null;
            }



]]>
存储q程q回的多l果集数据,ado 讉K调用http://www.aygfsteel.com/kiant/articles/294666.html黄小?/dc:creator>黄小?/author>Fri, 11 Sep 2009 00:17:00 GMThttp://www.aygfsteel.com/kiant/articles/294666.htmlhttp://www.aygfsteel.com/kiant/comments/294666.htmlhttp://www.aygfsteel.com/kiant/articles/294666.html#Feedback0http://www.aygfsteel.com/kiant/comments/commentRss/294666.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/294666.html 存储q程q回的多l果集数据,ado怎么打开q些l果集ƈ取得数据Q?/a>


SqlDataAdapter   myDataAdapter   =   new   SqlDataAdapter("GetRecordFromPage2",myConnection);  
  myDataAdapter.SelectCommand.CommandType   =   CommandType.StoredProcedure;  
   
  myDataAdapter.SelectCommand.Parameters.Add("@sqlstr",sqlstr);  
  myDataAdapter.SelectCommand.Parameters.Add("@pagecount",pagecount);  
  myDataAdapter.SelectCommand.Parameters.Add("@pagesize",pagesize);  
   
  DataSet   ds   =   new   DataSet();  
  myDataAdapter.Fill(ds);  
  return   ds;  
   
  ds.Tables[0],ds.Tables[1],ds.Tables[2],分别对应三个l果?br />


asp 下:(x)

<%   set   cmm=server.createobject("adodb.command")  
  set   rs=server.createobject("adodb.recordset")  
   
  cmm.commandtype=4  
  cmm.activeconnection=conn  
  cmm.commandtext="proc_name"  
  set   rs=cmm.execute  
  cmm.execute   %>  
   
      <%   while   not   rs.eof    
  response.write   rs(0)  
   
    rs.movenext  
      wend  
      %>  
      <%    
      set   rs2=rs.NextRecordset()  
      while   not   rs2.eof    
  response.write   rs2(0)  
              rs2.movenext  
      wend  
  ...........  
      rs2.close  
      set   rs2=nothing   %>


]]>
iis tomcat 服务集成http://www.aygfsteel.com/kiant/articles/291472.html黄小?/dc:creator>黄小?/author>Mon, 17 Aug 2009 05:59:00 GMThttp://www.aygfsteel.com/kiant/articles/291472.htmlhttp://www.aygfsteel.com/kiant/comments/291472.htmlhttp://www.aygfsteel.com/kiant/articles/291472.html#Feedback3http://www.aygfsteel.com/kiant/comments/commentRss/291472.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/291472.html 感谢 整合iis和tomcat 一文作者,依照他的说明我调试成功了
同时也感谢其他作者,你们的文章给了我不少启发

/Files/kiant/iis_tomcat.rar

]]>
C# E序发布/部v相关http://www.aygfsteel.com/kiant/articles/290093.html黄小?/dc:creator>黄小?/author>Thu, 06 Aug 2009 06:26:00 GMThttp://www.aygfsteel.com/kiant/articles/290093.htmlhttp://www.aygfsteel.com/kiant/comments/290093.htmlhttp://www.aygfsteel.com/kiant/articles/290093.html#Feedback0http://www.aygfsteel.com/kiant/comments/commentRss/290093.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/290093.html 手把手教你用C#打包应用E序(安装E序)

web.config 配置节点加密


配置环境:

Tomcat 虚拟路径Q?/strong>

3 在tomcat?server.xml配置文g中加?br /> <Host>
 .........
 <Context path="/upload" docBase="D:\upload" reloadable="false" />
</Host>

4 在d:盘根目录下新建upload文g?


IIS 配置

7 在安装完iis?在管理工?>Internet信息服务?IIS)->Internet 信息服务-->本地计算?>
  |站-->默认|站-->右键属?->文档->d->输入:index.jsp

8 安装.Net framework3.5

9 安装mysql-connector-net-6.0.3.zip用于.net链接mysql.

10 (g)查设|webservice的ip

11 配置IIS
 a.IIS的Web服务扩展中Active Server Pages 状况设ؓ(f)允许,
    ASP.Net v2.0.5.0727   状况设ؓ(f)允许,
  如果pȝ无默认找? 手动配置, cmd 执行 : c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i -enable
   Internet 数据q接?nbsp;  状况讄为允?
   在服务器端的包含文g  状况设ؓ(f)允许.
 b.配置|站属?br />    |站选项?默认
   性能选项?默认
   ISAPI{选器选项?默认
   ȝ录选项?此计机上的目录,c:\inetpub\wwwroot,脚本资源讉K,d,记录讉K,索引资源,默认应用E序,脚本和可执行文g,DefaultAppPool
   文档选项?dindex.asp
   目录安全性选项?w䆾验证和访问控?->~辑-->(g)查用户名和密?在windows用户中的讉K权限:来宾帐户.)
   http头选项?默认
   自定义错误选项?默认
   服务选项?默认
   ASP.NET选项?(g)查asp.net版本 v2.0 ,虚拟路径,文g位置
 c.配置|站权限
   扑ֈ应用E序所使用的Windows用户 (Internet 来宾帐户:开通允许匿名访?,qؓ(f)该用戯|访问权?
 d.配置应用的属?br />    目录选项?指定的目?脚本资源讉K,d,记录讉K,索引资源,应用E序?脚本可执行文?DefaultAppPool

/*** 
  发布时不要将资源攑֜默认的c:\inetpub\wwwroot目录?使用虚拟路径
 q且修改数据库链接串.


 

 



]]>
Enterprise Library 企业库笔?/title><link>http://www.aygfsteel.com/kiant/articles/289017.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Thu, 30 Jul 2009 02:25:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/289017.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/289017.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/289017.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/289017.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/289017.html</trackback:ping><description><![CDATA[<p>L安装 企业库和 MySQLq接</p> <p> </p> <p><strong>1.</strong><br /> Enterprise Library启用{֐后发?PublicKeyToken错误QHRESULT:0x80131040解决<br /> http://blog.csdn.net/cnming/archive/2007/07/15/1691714.aspx</p> <p>ps:我的解决Ҏ(gu) PublicKeyToken=null, 不设|秘?/p> <p> </p> <p><strong>2.Ҏ(gu)据库操作</strong></p> <p>http://pw.cnblogs.com/archive/2006/06/02/415431.html </p> <p> </p> <p><strong>3.</strong><br /> Microsoft.Practices.ObjectBuilder2.BuildFailedException: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database, HRPConnection]) failed: 找不到请求的 .Net Framework 数据提供E序。可能没有安装?(Strategy type ConfiguredObjectStrategy, index 2) ---> System.ArgumentException: 找不到请求的 .Net Framework 数据提供E序。可能没有安装?/p> <p><br /> <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null" /><br /> 改ؓ(f)(参见: x:\EntLib41Src\Quick Starts\Data\CS\DataAccessQuickStart\app.config CZ)<br /> <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data" /><br /> =======================================================<br /> 或者说最大的可能是没有相应的数据库链接驱?br /> 比如: 我的目中用的?mysql 配置文g?providerName="System.Data.SqlClient"<br /> 如果没有装相应的驱动 mysql-connector-net-6.0.3.zip有可能报这个错?</p> <p> </p> <p><strong>4. 数据库连?"未将对象引用到实? ?/strong><br /> 在家里机器上 "数据q接--MySQL Database--Server Name" 一栏填上本?IP地址 "10.0.0.99" ?x)提C错误信?"未将对象引用到实?, 改ؓ(f) "localhost" 可? 但是在公司机器上却没q个问题. <br /> (N是因为公怸机有提供 mysql服务, 所以直接连接主成功.<br /> 而个人家里面用的是精? 没安装服? 所以直接打 IP地址是连接不? 需改ؓ(f) localhost)</p> <p><br /> <strong>5. 步骤</strong><br /> 使用microsoft EnterpriseLibraryq接不同数据库简单应?<br /> 文章出处Qhttp://www.diybl.com/course/4_webprogram/asp.net/netjs/20081216/154074.html</p> <p> </p> <p> </p> <img src ="http://www.aygfsteel.com/kiant/aggbug/289017.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2009-07-30 10:25 <a href="http://www.aygfsteel.com/kiant/articles/289017.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C# XML的一点记?/title><link>http://www.aygfsteel.com/kiant/articles/289010.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Thu, 30 Jul 2009 02:11:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/289010.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/289010.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/289010.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/289010.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/289010.html</trackback:ping><description><![CDATA[<br /> C#dXMLҎ(gu)<br /> http://www.cnblogs.com/sopper/archive/2006/11/03/549435.html <br /> <br /> <br /> <hr /> <p><br />         XmlDocument doc = new XmlDocument();<br />         XmlElement root = doc.CreateElement("root");</p> <p>        XmlElement companyId = doc.CreateElement("companyId");<br />         companyId.InnerText = "1";<br />         root.AppendChild(companyId);</p> <p>        doc.AppendChild(root);<br />         string kk = doc.OuterXml;<br /> <br /> <br /> </p> <p>///////////////////////////<br /> <p>try<br />             {<br />                 XmlDocument doc = new XmlDocument();<br />                 XmlElement root = doc.CreateElement("root");<br />                 foreach (var item in dict)<br />                 {<br />                     XmlElement e = doc.CreateElement(item.Key);<br />                     e.InnerText = item.Value;<br />                     root.AppendChild(e);<br />                 }</p> <p>                doc.AppendChild(root);<br />                 return doc.OuterXml;<br />             }<br />             catch (Exception)<br />             {<br />                 return "";<br />             }</p> <p><br /> <br /> <br /> <hr /> <strong>?/strong><br /> <br />         XDocument doc = new XDocument(<br />             new XDeclaration("1.0", "utf-8", "yes"),<br />             new XElement("root",<br />                 new XElement("companyId", "1")<br />             )<br />         ); <p> </p> <p>        string kk = doc.ToString();<br /> <br /> ---------<br />         XDocument doc = new XDocument(new XDeclaration("1.0", "utf-8", "yes"));<br />         XElement root = new XElement("root");</p> <p>        XElement element = new XElement("companyId");<br />         element.Value = 1 + "";<br />         root.Add(element);</p> <p>        doc.Add(root);</p> <p><br /> <hr /> <strong>元素d</strong><br /> <br />         XElement els = XElement.Parse(msg);<br />         var companyId = from e in els.Elements("companyId")<br />                         select e;<br />         string kk = companyId.First().Value;<br /> <br /> <p> </p> <img src ="http://www.aygfsteel.com/kiant/aggbug/289010.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2009-07-30 10:11 <a href="http://www.aygfsteel.com/kiant/articles/289010.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Xml 处理c?更新?..)http://www.aygfsteel.com/kiant/articles/286878.html黄小?/dc:creator>黄小?/author>Wed, 15 Jul 2009 07:09:00 GMThttp://www.aygfsteel.com/kiant/articles/286878.htmlhttp://www.aygfsteel.com/kiant/comments/286878.htmlhttp://www.aygfsteel.com/kiant/articles/286878.html#Feedback0http://www.aygfsteel.com/kiant/comments/commentRss/286878.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/286878.html阅读全文

]]>
winForm 控g中右键点M件收?/title><link>http://www.aygfsteel.com/kiant/articles/284310.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Fri, 10 Jul 2009 04:21:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/284310.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/284310.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/284310.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/284310.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/284310.html</trackback:ping><description><![CDATA[<br /> <strong>DataGridView</strong> <br /> <a target="_blank">DataGridView上按右键弹出右键菜单前选中当前?/a> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">        </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> DataGridView1_CellMouseDown(</span><span style="color: #0000ff">object</span><span style="color: #000000"> sender, DataGridViewCellMouseEventArgs e)<br /> <img id="Codehighlighter1_106_313_Open_Image" onclick="this.style.display='none'; Codehighlighter1_106_313_Open_Text.style.display='none'; Codehighlighter1_106_313_Closed_Image.style.display='inline'; Codehighlighter1_106_313_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_106_313_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_106_313_Closed_Text.style.display='none'; Codehighlighter1_106_313_Open_Image.style.display='inline'; Codehighlighter1_106_313_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />        </span><span id="Codehighlighter1_106_313_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_106_313_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            DataGridView1.ClearSelection();<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            DataGridView1.Rows[e.RowIndex].Selected </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">true</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            DataGridView1.CurrentCell </span><span style="color: #000000">=</span><span style="color: #000000"> DataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_316_517_Open_Image" onclick="this.style.display='none'; Codehighlighter1_316_517_Open_Text.style.display='none'; Codehighlighter1_316_517_Closed_Image.style.display='inline'; Codehighlighter1_316_517_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_316_517_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_316_517_Closed_Text.style.display='none'; Codehighlighter1_316_517_Open_Image.style.display='inline'; Codehighlighter1_316_517_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_316_517_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/**/</span><span id="Codehighlighter1_316_517_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />2007-05-16 17:31 by HELLO [未注册用户] <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />?#8220;dataGridView1_CellMouseClick”q个事g <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />有些时候可以只弹出菜单Q没有选择单元|有时候只选择单元|没有弹出菜单 <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />如果菜单控g在绑在DATAGRIDVIEW上(dataGridView1.ContextMenuStrip = this.ContextSrtip1Q,又不能选择单元?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /></span><span style="color: #008000">*/</span></span></div> <br /> DataGridView 链接点M? <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #000000">        </span><span style="color: #008000">//</span><span style="color: #008000">内容点击, q判断所点击的列?/span><span style="color: #008000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #000000">        </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> dgvData_CellContentClick(</span><span style="color: #0000ff">object</span><span style="color: #000000"> sender, DataGridViewCellEventArgs e)<br /> <img id="Codehighlighter1_124_404_Open_Image" onclick="this.style.display='none'; Codehighlighter1_124_404_Open_Text.style.display='none'; Codehighlighter1_124_404_Closed_Image.style.display='inline'; Codehighlighter1_124_404_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_124_404_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_124_404_Closed_Text.style.display='none'; Codehighlighter1_124_404_Open_Image.style.display='inline'; Codehighlighter1_124_404_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" />        </span><span id="Codehighlighter1_124_404_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_124_404_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            DataGridView dgv </span><span style="color: #000000">=</span><span style="color: #000000"> sender </span><span style="color: #0000ff">as</span><span style="color: #000000"> DataGridView;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">string</span><span style="color: #000000"> columnName </span><span style="color: #000000">=</span><span style="color: #000000"> dgv.Columns[e.ColumnIndex].Name;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (</span><span style="color: #000000">"</span><span style="color: #000000">operation</span><span style="color: #000000">"</span><span style="color: #000000">.Equals(columnName))<br /> <img id="Codehighlighter1_306_394_Open_Image" onclick="this.style.display='none'; Codehighlighter1_306_394_Open_Text.style.display='none'; Codehighlighter1_306_394_Closed_Image.style.display='inline'; Codehighlighter1_306_394_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_306_394_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_306_394_Closed_Text.style.display='none'; Codehighlighter1_306_394_Open_Image.style.display='inline'; Codehighlighter1_306_394_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />            </span><span id="Codehighlighter1_306_394_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_306_394_Open_Text"><span style="color: #000000">{</span><span style="color: #008000">//</span><span style="color: #008000">如果点击的列名符?nbsp;               </span><span style="color: #008000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /></span><span style="color: #000000">                dgv.Rows.RemoveAt(e.RowIndex);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />            }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />        }</span></span></div> <br /> <br /> <br /> <strong>TreeView<br /> </strong><a target="_blank">c# winform TreeView控g中实现拖拽的功能</a><br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Codehighlighter1_0_3052_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_0_3052_Closed_Text.style.display='none'; Codehighlighter1_0_3052_Open_Image.style.display='inline'; Codehighlighter1_0_3052_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><img id="Codehighlighter1_0_3052_Open_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_0_3052_Open_Text.style.display='none'; Codehighlighter1_0_3052_Closed_Image.style.display='inline'; Codehighlighter1_0_3052_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><span id="Codehighlighter1_0_3052_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">节点拖拽事g</span><span id="Codehighlighter1_0_3052_Open_Text" style="display: none"><span style="color: #0000ff">#region</span><span style="color: #000000"> 节点拖拽事g</span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000">当用户开始拖动节Ҏ(gu)</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> tvModel_ItemDrag(</span><span style="color: #0000ff">object</span><span style="color: #000000"> sender, ItemDragEventArgs e)<br /> <img id="Codehighlighter1_118_299_Open_Image" onclick="this.style.display='none'; Codehighlighter1_118_299_Open_Text.style.display='none'; Codehighlighter1_118_299_Closed_Image.style.display='inline'; Codehighlighter1_118_299_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_118_299_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_118_299_Closed_Text.style.display='none'; Codehighlighter1_118_299_Open_Image.style.display='inline'; Codehighlighter1_118_299_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_118_299_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_118_299_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            TreeNode selectNode </span><span style="color: #000000">=</span><span style="color: #000000"> e.Item </span><span style="color: #0000ff">as</span><span style="color: #000000"> TreeNode;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">this</span><span style="color: #000000">.tvModel.SelectedNode </span><span style="color: #000000">=</span><span style="color: #000000"> selectNode;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">this</span><span style="color: #000000">.form.DoDragDrop(e.Item, DragDropEffects.Move);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000">对象拖入控件的边界?/span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> tvModel_DragEnter(</span><span style="color: #0000ff">object</span><span style="color: #000000"> sender, DragEventArgs e)<br /> <img id="Codehighlighter1_403_642_Open_Image" onclick="this.style.display='none'; Codehighlighter1_403_642_Open_Text.style.display='none'; Codehighlighter1_403_642_Closed_Image.style.display='inline'; Codehighlighter1_403_642_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_403_642_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_403_642_Closed_Text.style.display='none'; Codehighlighter1_403_642_Open_Image.style.display='inline'; Codehighlighter1_403_642_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_403_642_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_403_642_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            TreeNode enterNode </span><span style="color: #000000">=</span><span style="color: #000000"> (TreeNode)(e.Data.GetData(</span><span style="color: #0000ff">typeof</span><span style="color: #000000">(TreeNode)));<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (enterNode </span><span style="color: #000000">!=</span><span style="color: #000000"> </span><span style="color: #0000ff">null</span><span style="color: #000000">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                e.Effect </span><span style="color: #000000">=</span><span style="color: #000000"> DragDropEffects.Move;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">else</span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                e.Effect </span><span style="color: #000000">=</span><span style="color: #000000"> DragDropEffects.None;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000">在完成拖放操作时</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> tvModel_DragDrop(</span><span style="color: #0000ff">object</span><span style="color: #000000"> sender, DragEventArgs e)<br /> <img id="Codehighlighter1_742_2238_Open_Image" onclick="this.style.display='none'; Codehighlighter1_742_2238_Open_Text.style.display='none'; Codehighlighter1_742_2238_Closed_Image.style.display='inline'; Codehighlighter1_742_2238_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_742_2238_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_742_2238_Closed_Text.style.display='none'; Codehighlighter1_742_2238_Open_Image.style.display='inline'; Codehighlighter1_742_2238_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_742_2238_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_742_2238_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            TreeNode selectNode </span><span style="color: #000000">=</span><span style="color: #000000"> (TreeNode)(e.Data.GetData(</span><span style="color: #0000ff">typeof</span><span style="color: #000000">(TreeNode)));<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">0.如果选择源ؓ(f)I?nbsp;或者不是二U节点则退?/span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (selectNode </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #0000ff">null</span><span style="color: #000000"> </span><span style="color: #000000">||</span><span style="color: #000000"> selectNode.Level </span><span style="color: #000000">!=</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #0000ff">return</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">1.Ҏ(gu)鼠标坐标获得目标节点</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            Position.X </span><span style="color: #000000">=</span><span style="color: #000000"> e.X;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            Position.Y </span><span style="color: #000000">=</span><span style="color: #000000"> e.Y;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            Position </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.tvModel.PointToClient(Position);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            TreeNode targetNode </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.tvModel.GetNodeAt(Position);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">foreach</span><span style="color: #000000"> (TreeNode node </span><span style="color: #0000ff">in</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.tvModel.Nodes[</span><span style="color: #000000">0</span><span style="color: #000000">].Nodes)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                node.NodeFont </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Font(</span><span style="color: #0000ff">this</span><span style="color: #000000">.form.Font, FontStyle.Regular);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">2.获得要插入的目标节点索引</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            </span><span style="color: #0000ff">int</span><span style="color: #000000"> index </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (targetNode </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #0000ff">null</span><span style="color: #000000">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                index </span><span style="color: #000000">=</span><span style="color: #000000"> selectNode.Parent.Nodes.Count </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;      </span><span style="color: #008000">//</span><span style="color: #008000">目标节点为null, 直接插入到最?/span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> (targetNode.Level </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                index </span><span style="color: #000000">=</span><span style="color: #000000"> targetNode.Index </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;                   </span><span style="color: #008000">//</span><span style="color: #008000">目标节点为同U? 直接在之后插?/span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> (targetNode.Level </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                index </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;                                      </span><span style="color: #008000">//</span><span style="color: #008000">目标为根节点, 直接插入到最?/span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> (targetNode.Level </span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)<br /> <img id="Codehighlighter1_1795_2034_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1795_2034_Open_Text.style.display='none'; Codehighlighter1_1795_2034_Closed_Image.style.display='inline'; Codehighlighter1_1795_2034_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1795_2034_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1795_2034_Closed_Text.style.display='none'; Codehighlighter1_1795_2034_Open_Image.style.display='inline'; Codehighlighter1_1795_2034_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span id="Codehighlighter1_1795_2034_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_1795_2034_Open_Text"><span style="color: #000000">{                                                   </span><span style="color: #008000">//</span><span style="color: #008000">目标节点ZU节点以? 遍历到其二节点</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">                </span><span style="color: #0000ff">while</span><span style="color: #000000"> (targetNode.Level </span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                    targetNode </span><span style="color: #000000">=</span><span style="color: #000000"> targetNode.Parent;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                index </span><span style="color: #000000">=</span><span style="color: #000000"> index </span><span style="color: #000000">=</span><span style="color: #000000"> targetNode.Index </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">3.源节点删? 目标节点在烦引出插入, q亮选中</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            selectNode.Remove();<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">this</span><span style="color: #000000">.tvModel.Nodes[</span><span style="color: #000000">0</span><span style="color: #000000">].Nodes.Insert(index, selectNode);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">this</span><span style="color: #000000">.tvModel.SelectedNode </span><span style="color: #000000">=</span><span style="color: #000000"> selectNode;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000">对象拖q控件边~时</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> tvModel_DragOver(</span><span style="color: #0000ff">object</span><span style="color: #000000"> sender, DragEventArgs e)<br /> <img id="Codehighlighter1_2340_3033_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2340_3033_Open_Text.style.display='none'; Codehighlighter1_2340_3033_Closed_Image.style.display='inline'; Codehighlighter1_2340_3033_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_2340_3033_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_2340_3033_Closed_Text.style.display='none'; Codehighlighter1_2340_3033_Open_Image.style.display='inline'; Codehighlighter1_2340_3033_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_2340_3033_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_2340_3033_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            Position.X </span><span style="color: #000000">=</span><span style="color: #000000"> e.X;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            Position.Y </span><span style="color: #000000">=</span><span style="color: #000000"> e.Y;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            Position </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.tvModel.PointToClient(Position);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">在拖q的控g前后昄划线效果</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            TreeNode targetNode </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">this</span><span style="color: #000000">.tvModel.GetNodeAt(Position);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (targetNode </span><span style="color: #000000">!=</span><span style="color: #000000"> </span><span style="color: #0000ff">null</span><span style="color: #000000"> </span><span style="color: #000000">&&</span><span style="color: #000000"> targetNode.Level </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)<br /> <img id="Codehighlighter1_2634_3023_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2634_3023_Open_Text.style.display='none'; Codehighlighter1_2634_3023_Closed_Image.style.display='inline'; Codehighlighter1_2634_3023_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_2634_3023_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_2634_3023_Closed_Text.style.display='none'; Codehighlighter1_2634_3023_Open_Image.style.display='inline'; Codehighlighter1_2634_3023_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span id="Codehighlighter1_2634_3023_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_2634_3023_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #0000ff">if</span><span style="color: #000000"> (targetNode.PrevNode </span><span style="color: #000000">!=</span><span style="color: #000000"> </span><span style="color: #0000ff">null</span><span style="color: #000000">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                    targetNode.PrevNode.NodeFont </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Font(</span><span style="color: #0000ff">this</span><span style="color: #000000">.form.Font, FontStyle.Regular);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #0000ff">if</span><span style="color: #000000"> (targetNode.NextNode </span><span style="color: #000000">!=</span><span style="color: #000000"> </span><span style="color: #0000ff">null</span><span style="color: #000000">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                    targetNode.NextNode.NodeFont </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Font(</span><span style="color: #0000ff">this</span><span style="color: #000000">.form.Font, FontStyle.Regular);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                targetNode.NodeFont </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Font(</span><span style="color: #0000ff">this</span><span style="color: #000000">.form.Font, FontStyle.Underline);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />        </span><span style="color: #0000ff">#endregion</span></span></div> <br /> <img src ="http://www.aygfsteel.com/kiant/aggbug/284310.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2009-07-10 12:21 <a href="http://www.aygfsteel.com/kiant/articles/284310.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>mysql旉字段的格式与~码转换, C#?xml 存储旉数据的(f)时解x?/title><link>http://www.aygfsteel.com/kiant/articles/286217.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Fri, 10 Jul 2009 04:08:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/286217.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/286217.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/286217.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/286217.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/286217.html</trackback:ping><description><![CDATA[<p>因ؓ(f) C#里调?Dataset内置Ҏ(gu) GetXml()生成?xml字符串是?XMLSchema架构?br /> 其生成的 xml字符串里旉格式是以 "<span id="wmqeeuq" class="tx">2009-07-07T14:58:27+08:00" 存放?br /> <br /> <br /> 在接收端解析的时?如果没有 XMLSchema架构的注?nbsp; <br /> <span id="wmqeeuq" class="m"><</span><span id="wmqeeuq" class="t">xs:element</span> <span id="wmqeeuq" class="t">name</span><span id="wmqeeuq" class="m">="</span><strong>dept_createtime</strong><span id="wmqeeuq" class="m">"</span><span id="wmqeeuq" class="t"> type</span><span id="wmqeeuq" class="m">="</span><strong>xs:dateTime</strong><span id="wmqeeuq" class="m">"</span><span id="wmqeeuq" class="t"> minOccurs</span><span id="wmqeeuq" class="m">="</span><strong>0</strong><span id="wmqeeuq" class="m">"</span><span id="wmqeeuq" class="m"> /></span> <br /> xml 数据 "<span id="wmqeeuq" class="tx">2009-07-07T14:58:27+08:00" ?x)以默认的字W方式进行解?br /> <br /> <br /> 所以在目里我的解x法是在利?sql语句查询时就生成特定的字W串格式</span></span></p> Convert( DATE_FORMAT(n.node_begin_time, '%Y.%c.%e') using utf8) as begin_time <br /> //先利?DATE_FORMAT()函数q行样式格式?br /> //在利?Convert() 函数q行~码转换, 以生?C#字符串编码方? 否则?x)出现在数据库能正常昄? ?C#查询出来却成?System.Byte[]<br /> <br /> <br /> 参考文?<br /> <a target="_blank">MySQL利用DATE_FORMAT()函数完成字符串到旉cd的{换,旉的格式化</a><br /><img src ="http://www.aygfsteel.com/kiant/aggbug/286217.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2009-07-10 12:08 <a href="http://www.aygfsteel.com/kiant/articles/286217.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C# 定时器用一?/title><link>http://www.aygfsteel.com/kiant/articles/282489.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Mon, 15 Jun 2009 16:11:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/282489.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/282489.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/282489.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/282489.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/282489.html</trackback:ping><description><![CDATA[<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">using</span><span style="color: #000000"> System;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Collections.Generic;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Linq;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Text;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">namespace</span><span style="color: #000000"> ConsoleApplication1<br /> <img id="Codehighlighter1_117_1225_Open_Image" onclick="this.style.display='none'; Codehighlighter1_117_1225_Open_Text.style.display='none'; Codehighlighter1_117_1225_Closed_Image.style.display='inline'; Codehighlighter1_117_1225_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_117_1225_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_117_1225_Closed_Text.style.display='none'; Codehighlighter1_117_1225_Open_Image.style.display='inline'; Codehighlighter1_117_1225_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_117_1225_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_117_1225_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff">class</span><span style="color: #000000"> Program<br /> <img id="Codehighlighter1_141_688_Open_Image" onclick="this.style.display='none'; Codehighlighter1_141_688_Open_Text.style.display='none'; Codehighlighter1_141_688_Closed_Image.style.display='inline'; Codehighlighter1_141_688_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_141_688_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_141_688_Closed_Text.style.display='none'; Codehighlighter1_141_688_Open_Image.style.display='inline'; Codehighlighter1_141_688_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_141_688_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_141_688_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> Main(</span><span style="color: #0000ff">string</span><span style="color: #000000">[] args)<br /> <img id="Codehighlighter1_191_682_Open_Image" onclick="this.style.display='none'; Codehighlighter1_191_682_Open_Text.style.display='none'; Codehighlighter1_191_682_Closed_Image.style.display='inline'; Codehighlighter1_191_682_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_191_682_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_191_682_Closed_Text.style.display='none'; Codehighlighter1_191_682_Open_Image.style.display='inline'; Codehighlighter1_191_682_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_191_682_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_191_682_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            AddRoomTimer timer </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> AddRoomTimer();<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">while</span><span style="color: #000000"> (</span><span style="color: #0000ff">true</span><span style="color: #000000">)<br /> <img id="Codehighlighter1_283_510_Open_Image" onclick="this.style.display='none'; Codehighlighter1_283_510_Open_Text.style.display='none'; Codehighlighter1_283_510_Closed_Image.style.display='inline'; Codehighlighter1_283_510_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_283_510_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_283_510_Closed_Text.style.display='none'; Codehighlighter1_283_510_Open_Image.style.display='inline'; Codehighlighter1_283_510_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span id="Codehighlighter1_283_510_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_283_510_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #0000ff">if</span><span style="color: #000000"> (AddRoomTimer.COUNT </span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">)<br /> <img id="Codehighlighter1_345_496_Open_Image" onclick="this.style.display='none'; Codehighlighter1_345_496_Open_Text.style.display='none'; Codehighlighter1_345_496_Closed_Image.style.display='inline'; Codehighlighter1_345_496_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_345_496_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_345_496_Closed_Text.style.display='none'; Codehighlighter1_345_496_Open_Image.style.display='inline'; Codehighlighter1_345_496_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                </span><span id="Codehighlighter1_345_496_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_345_496_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                    Console.WriteLine(</span><span style="color: #0000ff">string</span><span style="color: #000000">.Format(</span><span style="color: #000000">"</span><span style="color: #000000">W{0}ơ调?/span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">101</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000"> AddRoomTimer.COUNT));<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                    AddRoomTimer.COUNT</span><span style="color: #000000">--</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />                }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /></span><span style="color: #000000">        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> AddRoomTimer<br /> <img id="Codehighlighter1_725_1223_Open_Image" onclick="this.style.display='none'; Codehighlighter1_725_1223_Open_Text.style.display='none'; Codehighlighter1_725_1223_Closed_Image.style.display='inline'; Codehighlighter1_725_1223_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_725_1223_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_725_1223_Closed_Text.style.display='none'; Codehighlighter1_725_1223_Open_Image.style.display='inline'; Codehighlighter1_725_1223_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_725_1223_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_725_1223_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000">静态计数器变量</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> COUNT </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        public static System.Threading.Timer timer;<br /> <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000">静态构? 最多运行一?/span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        </span><span style="color: #0000ff">static</span><span style="color: #000000"> AddRoomTimer()<br /> <img id="Codehighlighter1_844_1013_Open_Image" onclick="this.style.display='none'; Codehighlighter1_844_1013_Open_Text.style.display='none'; Codehighlighter1_844_1013_Closed_Image.style.display='inline'; Codehighlighter1_844_1013_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_844_1013_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_844_1013_Closed_Text.style.display='none'; Codehighlighter1_844_1013_Open_Image.style.display='inline'; Codehighlighter1_844_1013_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_844_1013_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_844_1013_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">多线E定时器, 每隔 10000毫秒调用一ơ被委托的方?nbsp;TimerCallBack</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            timer </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> System.Threading.Timer(TimerCallBack, </span><span style="color: #0000ff">null</span><span style="color: #000000">, </span><span style="color: #000000">0</span><span style="color: #000000">, </span><span style="color: #000000">10000</span><span style="color: #000000">);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> TimerCallBack(</span><span style="color: #0000ff">object</span><span style="color: #000000"> obj)<br /> <img id="Codehighlighter1_1078_1217_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1078_1217_Open_Text.style.display='none'; Codehighlighter1_1078_1217_Closed_Image.style.display='inline'; Codehighlighter1_1078_1217_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1078_1217_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1078_1217_Closed_Text.style.display='none'; Codehighlighter1_1078_1217_Open_Image.style.display='inline'; Codehighlighter1_1078_1217_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_1078_1217_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_1078_1217_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">打印一ơ时? 试?/span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            Console.WriteLine(DateTime.Now.ToString());<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">计数器变量重|?/span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            COUNT </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">100</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span></div> <img src ="http://www.aygfsteel.com/kiant/aggbug/282489.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2009-06-16 00:11 <a href="http://www.aygfsteel.com/kiant/articles/282489.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Winform H体相关http://www.aygfsteel.com/kiant/articles/280775.html黄小?/dc:creator>黄小?/author>Mon, 08 Jun 2009 16:05:00 GMThttp://www.aygfsteel.com/kiant/articles/280775.htmlhttp://www.aygfsteel.com/kiant/comments/280775.htmlhttp://www.aygfsteel.com/kiant/articles/280775.html#Feedback0http://www.aygfsteel.com/kiant/comments/commentRss/280775.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/280775.htmlWinform应用E序开发规范【{?rar
 

 
Form.ShowDialog(this);   不v作用
(g)?this.ShowInTaskbar = false; 是否存在?Designer.cs 代码?有时候可能是样出错的
或者说??nbsp;Designer.cs 代码中指定了一ơ,别的地方又指定了一ơ就?x)出问?br />             form.ShowInTaskbar = false;                   
            form.StartPosition = FormStartPosition.CenterParent;

?

当窗体显CZؓ(f)模式对话框时Q单?#8220;关闭”按钮Q窗体右上角?nbsp;X 的按钮)?x)隐藏窗体ƈ?nbsp;DialogResult 属性设|ؓ(f) DialogResult.Cancel。与无模式窗体不同,当用户单d话框的关闭窗体按钮或讄 DialogResult 属性的值时Q?NET Framework 不调?nbsp;Close Ҏ(gu)。窗体{而可以隐藏ƈ可重新显C,而不用创对话框的新实例。因为未关闭昄为对话框的窗体,所以在(zhn)的应用E序不再需要该H体Ӟ必须调用该窗体的 Dispose Ҏ(gu)?/span>



加蝲图?/strong>

把对应的图标文g拯?导入到资源文件下:

Resources.resx:
<data name="hrp" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>..\Resources\hrp.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
  </data>

在程序文?.cs?
form.Icon = (System.Drawing.Icon)global::XXXX.Properties.Resources.hrp;


详细可参?PictureBox lg装蝲文g方式.


]]>
?WinForm中?WebClient上传文ghttp://www.aygfsteel.com/kiant/articles/277929.html黄小?/dc:creator>黄小?/author>Tue, 26 May 2009 00:57:00 GMThttp://www.aygfsteel.com/kiant/articles/277929.htmlhttp://www.aygfsteel.com/kiant/comments/277929.htmlhttp://www.aygfsteel.com/kiant/articles/277929.html#Feedback0http://www.aygfsteel.com/kiant/comments/commentRss/277929.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/277929.html 使用指定的方法将指定的本地文件上载到指定的资?/a>

在WinForm中通过HTTP协议向服务器端上传文?/a>


1.服务器端处理E序
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Upload.aspx.cs" Inherits="Upload" %>
前台代码  Upload.aspx


using System;
using System.Web;

public partial class Upload : System.Web.UI.Page
{
    
//服务器默认保存\?/span>
    private readonly string serverPath = @"C:\upload\";

    
private void Page_Load(object sender, System.EventArgs e)
    
{   // 获取 http提交上传的文? q改名保?/span>
        foreach (string key in Request.Files.AllKeys)
        
{
            HttpPostedFile file 
= Request.Files[key];
            
string newFilename = DateTime.Now.ToString("yyMMddhhmmssffff")
                
+ file.FileName.Substring(file.FileName.LastIndexOf('.'));

            
try
            
{   //文g保存q返回相对\径地址
                file.SaveAs(this.serverPath + newFilename);
                Response.Write(
"upload/" + newFilename);
            }

            
catch (Exception)
            
{                
            }

        }

    }

}
后台代码 Upload.aspx.cs
 



2.客户端程?/strong>
       /// <summary>
        
/// 单个文g上传x务器
        
/// </summary>
        
/// <param name="uriAddress">接收文g资源的URI, 例如: http://xxxx/Upload.aspx</param>
        
/// <param name="filePath">要发送的资源文g, 例如: @"D:\workspace\WebService 相关.doc</param>
        
/// <returns>q回文g保存的相对\? 例如: "upload/xxxxx.jpg" 或者出错返?nbsp;""</returns>

        private string UploadFile(string uriAddress, string filePath)
        
{
            
//利用 WebClient
            System.Net.WebClient webClient = new System.Net.WebClient();
            webClient.Credentials 
= System.Net.CredentialCache.DefaultCredentials;
            
try
            
{
                
byte[] responseArray = webClient.UploadFile(uriAddress, "POST", filePath);
                
string savePath = System.Text.Encoding.ASCII.GetString(responseArray);
                
return savePath;
            }

            
catch (Exception)
            
{
                
return "";
            }

        }



ps.判断q程文g是否存在
        public bool UriExists(string url)
        
{
            
try
            
{
                
new System.Net.WebClient().OpenRead(url);
                
return true;
            }

            
catch (System.Net.WebException)
            
{
                
return false;
            }

        }
 



]]>
Connector/Net q接 MySQLq程服务器出?"Unable to connect to any of the specified MySQL hosts" 解决Ҏ(gu)http://www.aygfsteel.com/kiant/articles/270714.html黄小?/dc:creator>黄小?/author>Thu, 14 May 2009 13:32:00 GMThttp://www.aygfsteel.com/kiant/articles/270714.htmlhttp://www.aygfsteel.com/kiant/comments/270714.htmlhttp://www.aygfsteel.com/kiant/articles/270714.html#Feedback2http://www.aygfsteel.com/kiant/comments/commentRss/270714.htmlhttp://www.aygfsteel.com/kiant/services/trackbacks/270714.html
今天做项目时候就遇到q问?br /> 中文提示“找不到相应的L?#8221;

q时候请(g)查数据库服务器上 MySql.Data.dll 文g版本和项?bin 目录下的版本是否一致?/p>

如果q程L版本?6.0.3
而项目引用的?5.0.3
则会(x)出现以上的错误提C?/p>

但是如果本机L上版本是 6.0.3
即ə目引用的是 5.0.3
也能正常q接数据库,不清楚是什么原?/p>

]]>
关于 WinForm ?DataGridView , TreeView 的一点记?/title><link>http://www.aygfsteel.com/kiant/articles/270124.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Mon, 11 May 2009 14:38:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/270124.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/270124.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/270124.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/270124.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/270124.html</trackback:ping><description><![CDATA[     摘要: 一、编E方式修改被l定的数据对?nbsp;        //利用 DataBindingComplete 在数据绑定操作完成之后发?        private void dataGridView1...  <a href='http://www.aygfsteel.com/kiant/articles/270124.html'>阅读全文</a><img src ="http://www.aygfsteel.com/kiant/aggbug/270124.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2009-05-11 22:38 <a href="http://www.aygfsteel.com/kiant/articles/270124.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linq 使用心?/title><link>http://www.aygfsteel.com/kiant/articles/247876.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Tue, 23 Dec 2008 02:28:00 GMT</pubDate><guid>http://www.aygfsteel.com/kiant/articles/247876.html</guid><wfw:comment>http://www.aygfsteel.com/kiant/comments/247876.html</wfw:comment><comments>http://www.aygfsteel.com/kiant/articles/247876.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/kiant/comments/commentRss/247876.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/kiant/services/trackbacks/247876.html</trackback:ping><description><![CDATA[Linq查询操作的三步骤:<br /> 1.准备数据?br /> 2.创徏查询<br /> 3.执行查询<br /> <br /> 一般情况下Q查询变量本w不?x)保存查询结果,而是存储查询命o(h)。执行Linq查询存在两种方式Q?br /> <strong>延迟执行Q?br /> </strong>    是指查询表达式不是在其被创徏时执行,而是当需要访问(如?foreach 语句Q该查询的结果才执行查询表达式?br /> <strong>立即执行Q?br /> </strong>    是指查询表达式在其创建时qx行。如包含了Sum()、Count(){查询操作的查询表达式?br /> <br /> <br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Code_Closed_Image_103005" onclick="this.style.display='none'; Code_Closed_Text_103005.style.display='none'; Code_Open_Image_103005.style.display='inline'; Code_Open_Text_103005.style.display='inline';" height="16" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top" alt="" /><img id="Code_Open_Image_103005" style="display: none" onclick="this.style.display='none'; Code_Open_Text_103005.style.display='none'; Code_Closed_Image_103005.style.display='inline'; Code_Closed_Text_103005.style.display='inline';" height="16" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top" alt="" /><span id="Code_Closed_Text_103005" style="border-right: #808080 1px solid; border-top: #808080 1px solid; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">摘?/span><span id="Code_Open_Text_103005" style="display: none"><br /> <!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #000000">LINQ的确lh耳目一新的感觉Q因为其是C#</span><span style="color: #000000">3</span><span style="color: #000000">.0扩展的新语法Q直接将查询语言与编E语a集成在一起了Q用h实方便?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />qƈ不媄(jing)响系l的分层设计Q分层设计依然是软g设计的好Ҏ(gu)Q只是你又有了更厉害的武器LINQ而已?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />但你不能因ؓ(f)有了q个宝贝处处用它Q因为ƈ非所有的地方都适合LINQ的?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />LINQ毕竟是通过L的内存对象来讉K数据的,在v量数据处理的应用中,建立一个个的内存对象来处理数据的开销往往是天文数字。所以,O</span><span style="color: #000000">/</span><span style="color: #000000">R Mapping一般都是用在处理少量数据的情况Q对象化的处理可以带来方ѝ?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />q有是查询语言与编E语a集成也带来另一个问题,是查询代码?#8220;化”。所谓代码硬化,指的是代码被Zؓ(f)或自动写死,q在q行时不可更攏V也是_(d)“化”的代码遇到数据结构变化或查询需求变化时Q需要重CҎ(gu)代码Q再生成q行版本Q这?#8220;化”代码的通病?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />而以前的SQL语句本n是编E语a的字W串数据而已Q因此可以把SQL逻辑独立出来形成外部SQL文g或数据库内的存储q程Q当数据库需求变化时Q可以在不停止系l运行的情况下修改这些SQL逻辑完成需求变更。甚x些做得好的数据库pȝ是以“数据字典”驱动的,数据l构的Q何变化都不媄(jing)响编E语a的源代码?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />当然Q你也可以通过动态生成LINQq即时编译的办法来独立查询逻辑{,有兴可以试试?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" />MQQ何东襉K有利有弊Q要看具体情况而定。表现层、业务层和数据层也ƈ非一定要从物理上划分Q只要逻辑上存在分层即可,只要化设计帮助h们理解即可?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></span></div> <br /> <img src ="http://www.aygfsteel.com/kiant/aggbug/247876.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/kiant/" target="_blank">黄小?/a> 2008-12-23 10:28 <a href="http://www.aygfsteel.com/kiant/articles/247876.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">ԭ</a>| <a href="http://" target="_blank">潭</a>| <a href="http://" target="_blank">ͨ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ó</a>| <a href="http://" target="_blank">˼</a>| <a href="http://" target="_blank">½</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ຣʡ</a>| <a href="http://" target="_blank">ɳ</a>| <a href="http://" target="_blank">Ӣɳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ӳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˫</a>| <a href="http://" target="_blank">²</a>| <a href="http://" target="_blank">ī</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͭ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ǿ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">⳵</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">ֳ</a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>