string connstring = "server=.;database=pubs;uid=sa;pwd=;pooling=true"
sqlconnection cn = new sqlconnection("data source=你資料庫的位址;database=資料庫名稱;uid=資料庫使用者名稱;pwd=資料庫密碼;");
using system;
using system.collections.generic;
using system.linq;
using system.text;
using system.data;
using system.data.oledb;
using system.io;
namespace accessc
///
/// 返回執行所受影響的函式
///
///
///
public int executegetlines(string com)
catch (exception e)
finally }
///
/// 統計特定條件的數量
///
///
///
public int exectecount(string com)
catch (exception e)
finally }
///
/// 返回結果的第一行第一列
///
///
///
public object executegetcol(string com)
catch (exception e)
finally }
///
/// 返回乙個資料集合datatable
///
///
///
public datatable executegettable(string com)
catch (exception e)
finally }
///
/// 關閉連線
///
public void closecon() }
}
Access資料庫操作類
using system using system.data.oledb using system.data using system.diagnostics using system.collections.generic namespace common public static string...
C 編寫 access資料庫操作類
using system using system.data using system.web using system.configuration using system.data.oledb using system.web.ui.webcontrols namespace accdb 科長 ...
C 操作Access資料庫
using system using system.collections.generic using system.linq using system.text using system.data using system.data.oledb using system.configuration...