之前寫的類存在Excel進程不能結束的Bug,重寫ExcelReader類,類實例清理時Excel進程自動結束. class ExcelReader { // Excel Object public Application app; public Workbooks wbs; public Workbook wb; public Worksheet ws; public Range rng; private bool disposed = false; public ExcelReader()…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Data.OleDb; using System.Data; using System.Windows.Forms; namespace WmsClient { public class ExcelHelper { //Excel導入DataSet public st…
1.定義連接字符串 var source = "server=(local); integrated security=SSPI; database=test"; var conn = new SqlConnection(source); 2.構架Tables Tables的構架是由Columns支撐的,即定義一張表需要說明清楚這張表包含有哪些列,這些列的屬性是什麼?例如定義一張Users表,則需要說明Users表包含的列(Id,Name,Age),以及列的屬性,如Id為主鍵,是int…
public abstract void onUpgrade(SQLiteDatabase db,int oldVersion,int new Version) 這個方法在實現時需要重寫. public abstract void onUpgrade(SQLiteDatabase db,int oldVersion,int new Version) 這個方法在實現時需要重寫. onUpgrade方法會在數據庫需要升級的時候調用.可以用來增刪表或者其他任何操作.如果你想添加新的列你可以使用AL…