摘要:'> ...
阅读全文
08 2010 档案
摘要:在html里绑定数据,如果绑定的数据需要判断,如果有两个条件,可以使用三元运算符: 例如:A=="5" ? "B" : "C" 如果一个Lable绑定数据:'>,如果需要判断可以这样写: '>, 当条件多于两个时,可用嵌套运算: '>, 依次类推。
阅读全文
摘要://增加项或列(字段) ListView1.Clear; ListView1.Columns.Clear; ListView1.Columns.Add; ListView1.Columns.Add; ListView1.Columns.Add; ListView1.Columns.Items[0].Caption:='id'; ListView1.Columns.Items[1].Capt...
阅读全文
摘要:ListView1.Items.Count
阅读全文
摘要:SqlDataAdapter adapter = new SqlDataAdapter(SelectSql,conn); DataSet ds = new DataSet(); adapter.Fill(ds,"LogAccount"); DataTable DT = ds.Tables["LogAccount"]; 总记录数为:DT.Rows.Count
阅读全文
摘要:近来发现数据库过大,空间不足,因此打算将数据库的数据进行全面的清理,但表非常多,一张一张的清空,实在麻烦,因此就想利用SQL语句一次清空所有数据.找到了三种方法进行清空.使用的数据库为MS SQL SERVER. 1.搜索出所有表名,构造为一条SQL语句 declare@trun_namevarchar(8000) set@trun_name='' select@trun_name=@trun_name+'truncatetable'+[name]+''fromsysobjectswherextype='U'andstatus&g
阅读全文
摘要:用SQL2008导出数据库的时候,会导致数据库中的主键、索引、标识等数据库约束丢失。这里以SQL2008为例,介绍一下如何能导数据,又可以保持主键、索引、标识等数据库约束不丢失的方法。首先,在本地sql2008上面的数据库上右键-任务(T)-生成脚本(E),点击下一步,勾选下面的“为所选数据库中的所有对象编写脚本”-点击下一步-可以看到“编写数据的脚本”(SQL2005无此选项)后面是False,双击改为TRUE,拉下来-可以看到“为服务器版本编写脚本”,双击选择SQL2005(根据远程数据库版本而定,我要导的数据库是SQL2005所以选它)-点击下一步-再点击下一步-点击“完成”,脚本出现在
阅读全文
摘要:using System; using System.Collections.Generic; using System.Text; using System.Collections; namespace 生成N个不重复随机数的两个函数 { class Program { static void Main(string[] args) { DateTime d1 = System.DateTime...
阅读全文
摘要:1. 打开新的窗口并传送参数: 传送参数: response.write("<script>window.open(’*.ASPx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>") 接收参数: string a = Request.QueryString("id"); string b...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Threading;namespace jayleke{ public class HttpHelper { #region 私有变量 private static CookieC...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO;namespace Czt.Web { /// <summary> /// 实现网站登录类 /// </summary> public class Post { /// &l...
阅读全文
摘要:如果你在使用ListView控件自定义数据源时使用DataPager进行分页出现“ 具有的数据源必须实现 ICollection,或在 AllowPaging 为 true 的情况下可执行数据源分页。” 这样的错误提示,说明你使用的是datareader作为的数据源;因为DataReader每次只在内存中加载一条数据……;将数据源改为datase...
阅读全文
摘要:protected void Page_Load(object sender, EventArgs e) { HtmlGenericControl autoCompleteScript = new HtmlGenericControl("script"); autoCompleteScript.Attributes.Add("type", "text/javascript"); autoComp...
阅读全文
摘要:在asp.net中没有messagebox用法。。要是直接用response.write("#######")的话,就会直接在页面上显示######,这样看起来很杂乱,也不美观,更不容易看。还是用对话框的形式显示会比较好点。方法:直接写代码:Response.Write("<script>window.alert('#######');</script>");就可以了。Re...
阅读全文
摘要:在c# / ASP.net中我们可以通过使用DataTime这个类来获取当前的时间。通过调用类中的各种方法我们可以获取不同的时间:如:日期(2008-09-04)、时间(12:12:12)、日期+时间(2008-09-04 12:11:10)等。//获取日期+时间DateTime.Now.ToString(); // 2008-9-4 20:02:10DateTime.Now.ToLocalTim...
阅读全文
摘要:代码循环读取dataset代码
阅读全文