vs2003(c#)学习心得(重点难点)

vs2003(c#)学习心得(重点难点)

ID:7866538

大小:25.87 KB

页数:15页

时间:2018-03-01

vs2003(c#)学习心得(重点难点)_第1页
vs2003(c#)学习心得(重点难点)_第2页
vs2003(c#)学习心得(重点难点)_第3页
vs2003(c#)学习心得(重点难点)_第4页
vs2003(c#)学习心得(重点难点)_第5页
资源描述:

《vs2003(c#)学习心得(重点难点)》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、VS2003(C#)学习心得(重点难点)考虑问题步骤:SQL->Javascript->C#1.把数据库的多字段合并为一个字段显示与导出(也可以用String做:Strings+=sqlDr.GetString(i))出处:ERma/Apps/MCfg/QueryMcfg.aspx(1)protectedStringWriteAttributeCell(SqlDataReadersqlDr){intattributeCount=0;inti;Strings="";if(!sqlDr.IsDBNull(4)){attributeCount=sqlDr.GetInt32(4)

2、;if(attributeCount>0){for(i=0;i0){s+=";";}if(!sqlDr.IsDBNull(9+i)){s+=Server.HtmlEncode(sqlDr.GetString(9+i).Trim());}}}else{s+=" ";}}returns;}(2)String或StringBuilder对象的串联操作的性能取决于内存分配的发生频率。String串联操作每次都分配内存,而StringBuilder串联操作仅当StringBuilder对象缓冲区太小而无法容纳新数据时才分

3、配内存。因此,如果串联固定数量的String对象,则String类更适合串联操作。这种情况下,编译器甚至会将各个串联操作组合到一个操作中。如果串联任意数量的字符串,则StringBuilder对象更适合串联操作;例如,某个循环对用户输入的任意数量的字符串进行串联。SqlDataReadersqlDr=null;StringBuilderbufType=null;bufType=newStringBuilder();this.WriteAttributeCell(sqlDr,bufType);if(!sqlDr.IsDBNull(4)&&sqlDr.GetInt32(4)!

4、=0){ExcelDbTool.SetCommandParameterValue(oleCmd,7,this.bufType.ToString(),true);bufType.Remove(0,bufType.Length);}else{ExcelDbTool.SetCommandParameterValue(oleCmd,7,"",true);bufType.Remove(0,bufType.Length);}protectedvoidWriteAttributeCell(SqlDataReadersqlDr,StringBuilderbufType){intattri

5、buteCount=0;inti;if(!sqlDr.IsDBNull(4)){attributeCount=sqlDr.GetInt32(4);if(attributeCount>0){for(i=0;i0){bufType.Append(";");}bufType.Append(Server.HtmlEncode(sqlDr.GetString(9+i).Trim()));}}else{bufType.Append(" ");}}}(3)多字段合并为一个字段(SQL)selecttop2(rmanum+';

6、'+cast(accreditsiteidasnvarchar(100)))ashebinfromrmasys_3thrma結果:RUNW0708SNW189;-10RUWD0708SPW188;-82.用对话框弹出信息(1)this.msg=this["Msg_GenerateExcelException"]+""+e.Message;Response.Write("r");Response.Write("r");(2)Res

7、ponse.Write("");Response.Write("");Response.Write("Show:"+showQty.ToString()+";Hide:"+(recordCount-idx).ToString()+";Total:"+recordCount.ToString()+";Pleaseexporttoexceltoviewall(<65534)!");Response.Write("

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。