複製代碼 代碼如下:using System; using System.Collections.Generic; using System.Text; using System.Drawing; using System.IO; using System.Drawing.Imaging; using System.Web; using System.Drawing.Drawing2D; using System.Reflection; namespace Chen { public
複製代碼 代碼如下:/// <summary> /// 執行多條sql語句,實現事務 /// </summary> /// <param name="arraySql">多條sql語句</param> public int ExecutrSqlTran(System.Collections.ArrayList arraySql) { int itemnum; DbOpen(); SqlCommand cm = new SqlCommand();
複製代碼 代碼如下:using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;
這裡值得一提的是,web控制項image不像winForm控制項那樣可以通過讀取二進位流賦值給image屬性來顯示映像。可以通過變通的方法來實現,流行的做法是建立一個頁面專門用來顯示映像,這裡代碼直接用孟子E章前輩的(作了小修改,主要是剔除78個byte位元組流來正常顯示northwind資料庫的圖片): ReadImage.aspx.cs 複製代碼 代碼如下:using System; using System.Collections; using System.Configuration;
代碼如下: 複製代碼 代碼如下:namespace RandomTest { class Program { static void Main(string[] args) { for (int i = 0; i < 100; i++) { Random d = new Random(); Console.WriteLine(d.Next(100)); } } } } 理論上而言,這個程式會產生100個不同的0~100的整數,而實際情況卻是除了第一個數字不同外,剩餘99個數字會產生隨機的9
資料庫表:CategoryInfo 欄位名 類型 ciID int //記錄序號,自增量 ciName nvarchar(20) //分類名 ciParent int //父分類序號 ciLayer int //所處的層次 ciDescription nvarchar(200) //對分類的描述 分類的類設計 public class CategoryInfo { private int ciID;//分類ID private string ciName;//分類名 private int
SQLHelper.cs複製代碼 代碼如下:using System; using System.Collections.Generic; using System.Text; using System.Collections; using System.Data; using System.Data.SqlClient; using System.Configuration; namespace HelloWinForm.DBUtility { class SQLHelper {