三層架構之資料庫訪問層完全篇 C

2021-04-14 00:32:19 字數 1765 閱讀 6541

using system;

using system.data;

using system.data.sqlclient;

using system.configuration;

namespace dbbase

#endregion

#region "functions of base class"

public base()

///

/// executing sql commands

///

/// string

/// return int

protected static int executesql(string strsql)

catch(system.data.sqlclient.sqlexception e)

finally

}///

///executing sql commands

///

/// 要執行的sql語句,為字串型別string

/// 返回執**況,整形int

protected static int executesqlex(string strsql)

else

}catch(system.data.sqlclient.sqlexception e)

finally

}///

/// get dataset

///

/// (string)

/// (dataset)

protected static dataset executesql4ds(string strsql)

catch(system.data.sqlclient.sqlexception e)

finally

}///

/// get single value

///

/// (string)

/// (int)

protected static int executesql4value(string strsql)

else

}catch(system.data.sqlclient.sqlexception e)

finally

}  ///

/// get object

///

/// (string)

/// (object)

protected static object executesql4valueex(string strsql)

else

}catch(system.data.sqlclient.sqlexception e)

finally

}///

/// execute multipul sql commands

///

/// string

/// int

protected static int executesqls(string strsqls)

catch(system.data.sqlclient.sqlexception e)

sqltransaction mytrans = mycn.begintransaction();

trymytrans.commit();

return 0;

}catch(system.data.sqlclient.sqlexception e)

finally

}#endregion}}

三層架構之資料庫訪問層完全篇 C

using system using system.data using system.data.sqlclient using system.configuration namespace dbbase endregion region functions of base class public...

三層架構之資料庫訪問層完全篇 C

using system using system.data using system.data.sqlclient using system.configuration namespace dbbase endregion region functions of base class public...

資料庫 三層架構

資料層 dal 業務邏輯層 bll 表示層 ui 三層結構原理 3個層次中,系統主要功能和業務邏輯都在業務邏輯層進行處理。所謂三層體系結構,是在客戶端與資料庫之間加入了乙個 中間層 也叫元件層。這裡所說的三層體系,不是指物理上的三層,不是簡單地放置三颱機器就是三層體系結構,也不僅僅有b s應用才是三...