二.下面讲述6种常用集合 1.ArrayList类 using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { ArrayList al = new ArrayList(); al.Add(100);//单个添加 foreach (int number in new int[6] { 9, 3, 7, 2, 4, 8 Read More
posted @ 2009-08-05 15:19 汉卿 Views(259) Comments(0) Diggs(0) Edit
DataGridView的常用用法 //读取表Supplier并绑定到GridView中 private void BindGvSupplier() ...{ OracleConnection conn = this.Conn(); OracleCommand cmd = new OracleCommand( "select * from Supplier ", conn); OracleDataAdapter sda = new OracleDataAdapter(cmd); DataSet ds = new DataSet(); sda.Fill(ds, "S Read More
posted @ 2009-08-05 13:54 汉卿 Views(853) Comments(0) Diggs(0) Edit
RegisterStartupScript(key, script)RegisterClientScriptBlock(key, script) 这两个方法的作用都是从前台向后台写脚本,且都接受两个字符串作为输入。第二个参数 script 是要插入到页面中的客户端脚本,包括 <script> 的起始标记和终止标记。第一个参数 key 是插入的客户端脚本的唯一标识符。 这两个方法唯一的不同之处在于从“何处”发送脚本块。RegisterClientScriptBlock() 在 Web 窗体的开始处(紧接着 <form runat="server"> 标识之后)发送脚本块,而 Read More
posted @ 2009-08-05 13:36 汉卿 Views(179) Comments(0) Diggs(0) Edit
为了方便的访问数据,微软自己封装了一个数据访问模块, 即Data Access Application Block. 通过它,我们用来访问数据库的编码量大大减少了. 这样的代码既有效率,又减少了出现错误的几率,其益处是可见的. 下面举两个例子比较一下 1. 使用一般的sql语句进行控件绑定, 常规代码如下: 1//Create the connection and sql to be executed2string strConnTxt = "Server=(local);Database=Northwind;Integrated Security=True;";3stri Read More
posted @ 2009-08-05 10:18 汉卿 Views(177) Comments(0) Diggs(0) Edit