上一页 1 2 3 4 5 6 7 ··· 12 下一页
摘要: 后台从数据库里读出数据并按格式现实:显示问题和答案的时候 标签格式固定 有问题编号 选项序号 protected void InfoBind() { Ds = upays.Function_ReturnDataSet(CommandType.Text, "select * from Survey_Title where Tid=" + Convert.ToInt32(Request.QueryString["id"])); if (Ds != null && Ds.Tables[0].Rows.Count == 1) { T... 阅读全文
posted @ 2012-04-21 12:02 sidihu 阅读(201) 评论(0) 推荐(0)
摘要: 类:using System;using System.Collections.Generic;using System.Text;using System.Data.OleDb;using System.Data.SqlClient;using System.Data;using Model;namespace BLL.BLLCustom{ public class ReadCsv { private string _filename; private string _filepath; private OleDbConnection O... 阅读全文
posted @ 2012-04-21 11:59 sidihu 阅读(345) 评论(0) 推荐(0)
摘要: 很多人都认为Close()方法内部会调用Dispose()方法,所以并没有本质的区别!实际上这个看法不是很准确,对有些类来说,的确Close()和Dispose()没有本质区别,但是对有些类来说并非如此! 首先,让我们看看我们最常使用的SqlConnection的Close()方法和Dispose()方法的区别: SqlConnection类的Dispose()方法是继承于Component类的,源代码是这样的: publicvoidDispose(){ Dispose(true);//调用Dispose的一个带参数的重载 GC.SuppressFinalize(this);//请求系统不要. 阅读全文
posted @ 2012-04-21 11:56 sidihu 阅读(396) 评论(0) 推荐(0)
摘要: 在 using 语句中创建一个实例,确保退出 using 语句时在对象上调用 Dispose。当到达 using 语句的末尾,或者如果在语句结束之前引发异常并且控制离开语句块,都可以退出 using 语句。实例化的对象必须实现 System.IDisposable 接口。简单点说就是可以自动释放对象(托管资源) 阅读全文
posted @ 2012-04-21 11:56 sidihu 阅读(1273) 评论(0) 推荐(0)
摘要: C#中使用split分割字符串的几种方法- -第一种方法:string s=abcdeabcdeabcde;string[] sArray=s.Split('c') ;foreach(string i in sArray)Console.WriteLine(i.ToString());output:abdeabdeabde第二种方法:我们看到了结果是以一个指定的字符进行的分割。使用另一种构造方法对多个字符进行分割:string s=abcdeabcdeabcdestring[] sArray1=s.Split(new char[3]...{'c','d& 阅读全文
posted @ 2012-04-21 11:55 sidihu 阅读(228) 评论(0) 推荐(0)
摘要: 表单提交中Get和Post方式的区别有5点1. get是从服务器上获取数据,post是向服务器传送数据。2.get是把参数数据队列加到提交表单的ACTION属性所指的URL中,值和表单内各个字段一一对应,在URL中可以看到。post是通过HTTPpost机制,将表单内各个字段与其内容放置在HTML HEADER内一起传送到ACTION属性所指的URL地址。用户看不到这个过程。3. 对于get方式,服务器端用Request.QueryString获取变量的值,对于post方式,服务器端用Request.Form获取提交的数据。4. get传送的数据量较小,不能大于2KB。post传送的数据量较大 阅读全文
posted @ 2012-04-21 11:55 sidihu 阅读(168) 评论(0) 推荐(0)
摘要: Ds = famous.shop_select_bychecked(0); Dt = Ds.Tables[0].Clone(); foreach (DataColumn Dc in Dt.Columns) { if (Dc.ColumnName == "BID" || Dc.ColumnName == "SID") { Dc.DataType=typeof(string); } } foreach (DataRow Dr in Ds.Tables[0].Rows) { DataRow dr =Dt.NewRow(); dr["SHOPID&qu 阅读全文
posted @ 2012-04-21 11:53 sidihu 阅读(1171) 评论(0) 推荐(0)
摘要: 今天写历遍删除文件居然忘记怎么写了 晕倒 以后要多看书加强记忆......... string Paths = Server.MapPath("rent_pic/"); DirectoryInfo Di = new DirectoryInfo(Paths); try { for (int i = 0; i < GVinfo.Rows.Count; i++) { Label Lid = (Label)GVinfo.Rows[i].FindControl("Lid"); CheckBox Cb = (CheckBox)GVinfo.Rows[i].Fi 阅读全文
posted @ 2012-04-21 11:52 sidihu 阅读(185) 评论(0) 推荐(0)
摘要: 在ASP.Net中对各个WebForm控件引入以前没有的EnableViewState属性。这个属性究竟有什么用。我们知道对于WebForm而言,其代码是在服务器端的,以处理客户端的请求。当用户通过浏览器浏览网页的时候,会对网页进行某些操作,比如打开新链接,或单击某个按钮。在ASP中,这些是通过脚本语言对其进行处理,之后再传递给服务器端。但是在ASP.NET下,由于采用了code behind技术,在coding的时候,通常是将以前客户端完成的工作放到了服务器端。那么,服务器是怎么知道客户的操作的呢?比如我在文本框输入的内容,或者单击了登录按钮,服务器端是怎样得到这些信息的呢?因为没有这些信息 阅读全文
posted @ 2012-04-21 11:51 sidihu 阅读(133) 评论(0) 推荐(0)
摘要: using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;public p 阅读全文
posted @ 2012-04-21 11:51 sidihu 阅读(222) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 12 下一页