using system;
using system.data;
using system.web;
using system.configuration;
using system.data.oledb;
using system.web.ui.webcontrols;
namespace accdb
//科長-2006-07-write
//access資料庫操作類
///
/// 建立sql連線
///
///
/// 執行sql語句
///
/// 要執行的sql語句
public static void dosql(string strsql )
///
/// 更新和刪除sql語句
///
/// sql語句
/// bool是否執行成功
public static bool executeupdate(string sql)
else
}catch//(exception ex)
}///
/// 傳入sql語句,返回乙個dataset型別的資料表集合
///
/// sql語句字串
/// dataset
public static dataset getdataset (string strsql)
///
/// 傳入sql語句返回乙個datatable
///
/// sql語句
///
public static datatable getdatatable(string strsql)
///
/// 傳入sql語句,datagrid資料幫定
///
/// 分頁數
/// datagrid名稱
/// sql語句
public static void binddatagrid (int intpagenumber,datagrid dg_name,string strsql )
catch (oledbexception ex)
finally}}
}
C 操作Access資料庫類
string connstring server database pubs uid sa pwd pooling true sqlconnection cn new sqlconnection data source 你資料庫的位址 database 資料庫名稱 uid 資料庫使用者名稱 pwd ...
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.collections.generic using system.linq using system.text using system.data using system.data.oledb using system.configuration...