摘要: repeater OnItemCommand 事件中TextBox txt = (TextBox)e.Item.FindControl("repeater中控件名称");然后执行数据库更新操作,更新数据foreach (RepeaterItem item in Repeater1.Items) { TextBox txtNiName = (TextBox)item.FindControl("txtNiName"); string name=txtNiName.text; } 阅读全文
posted @ 2011-08-15 12:01 易尔购 阅读(3651) 评论(0) 推荐(0) 编辑
摘要: 一直没弄明白怎么在类库中找不到 ConfigurationManager.ConnectionStrings 后面才发现没有添加System.configuration的引用,添加后:引入命名空间: 代码如下:using System.Configuration;便可以使用了: 代码如下:public static string ConnectionString = ConfigurationManager.ConnectionStrings["Conn"].ToString();详细出处参考:http://www.jb51.net/article/18872.htm 阅读全文
posted @ 2011-08-15 11:30 易尔购 阅读(3486) 评论(2) 推荐(0) 编辑
摘要: <asp:BoundField DataField="QianShouEr" HeaderText="欠收额(元)" DataFormatString="{0:C}" HtmlEncode="false"> <HeaderStyle BorderColor="Black" BorderWidth="1px" HorizontalAlign="Center" VerticalAlign="Middle" Width=&q 阅读全文
posted @ 2011-08-15 10:56 易尔购 阅读(700) 评论(0) 推荐(0) 编辑
摘要: 字符型转换 转为字符串 12345.ToString("n"); //生成 12,345.00 12345.ToString("C"); //生成 ¥12,345.00 12345.ToString("e"); //生成 1.234500e+004 12345.ToString("f4"); //生成 12345.0000 12345.ToString("x"); //生成 3039 (16进制) 12345.ToString("p"); //生成 1,234,500.00% 阅读全文
posted @ 2011-08-15 10:38 易尔购 阅读(3372) 评论(0) 推荐(1) 编辑
摘要: {0:d} YY-MM-DD{0:p} 百分比00.00%{0:N2} 12.68{0:N0} 13{0:c2} $12.68{0:d} 3/23/2003{0:T} 12:00:00 AM{0:男;;女} “;”字符用于分隔格式字符串中的正数、负数和零各部分。DataGrid-数据格式设置表达式 这里需要注意以下几点1. 在GridView中的asp:BoundField使用DataFormatString必须设置属性HtmlEncode="False",否则不起作用。2. 如果需要使用日期类型的格式化字符串,必须数据实体中对应的字段也应该日起类型的。3. 格式化字符串C 阅读全文
posted @ 2011-08-15 10:20 易尔购 阅读(6030) 评论(0) 推荐(0) 编辑
摘要: <asp:TemplateColumn HeaderText="金额(元)"> <itemstyle horizontalalign="Right" /> <footerstyle horizontalalign="Right" width="8%" /> <footertemplate > <asp:Label id="Alltotal" runat="server" ReadOnly="true" 阅读全文
posted @ 2011-08-15 10:12 易尔购 阅读(4968) 评论(0) 推荐(0) 编辑
摘要: if (Directory.Exists(oldPath)) { Directory.Move(oldPath, path); if (OADBHelper.GetInt(sql) > 0) { Response.Write("<script>alert('更新成功!');</script>"); } else { Response.Write("<script>alert('更新失败!');</script>"); } } else { Response.Write( 阅读全文
posted @ 2011-08-14 16:23 易尔购 阅读(2696) 评论(1) 推荐(0) 编辑
摘要: 把c:\aa.txt 改名成 c:\bb.txtstring srcFileName=@ "c:\meng\a.txt "; string destFileName=@ "c:\meng\b.txt "; string srcFolderPath=@ "c:\temp "; string destFolderPath=@ "c:\temp11 "; //方法一 if (System.IO.File.Exists(srcFileName)) { System.IO.File.Move(srcFileName,dest 阅读全文
posted @ 2011-08-14 12:11 易尔购 阅读(3874) 评论(0) 推荐(0) 编辑
摘要: 实现修改文件名的方法很多,这里主要通过FileInfo对象的MoveTo方法。语法 public void MoveTo ( string destFileName )参数 destFileName 要将文件移动到的路径,可以指定另一个文件名。实现:首先引入命名空间:using System.IO;关键代码:string path = Server.MapPath("myfiles/2.gif"); FileInfo fi = new FileInfo(path); if (fi.Exists) { fi.MoveTo(Server.MapPath("myfile 阅读全文
posted @ 2011-08-14 11:41 易尔购 阅读(537) 评论(0) 推荐(0) 编辑
摘要: <asp:TemplateColumn HeaderText="金额(元)"> <itemstyle horizontalalign="Right" /> <footerstyle horizontalalign="Right" width="8%" /> <footertemplate > <asp:Label id="Alltotal" runat="server" ReadOnly="true" 阅读全文
posted @ 2011-08-13 15:43 易尔购 阅读(206) 评论(0) 推荐(0) 编辑