發(fā)表日期:2019-04 文章編輯:小燈 瀏覽次數(shù):3146
PageAdmin系統(tǒng)提供了一個內(nèi)置的數(shù)據(jù)庫訪問對象,聲明如下:
DataBaseContext?dbContext?=?DbHelper.DbContext();
DataBaseContext是PageAdmin.Utils工具類提供的對象,可用于各種數(shù)據(jù)庫有關(guān)的操作。
下面列舉一下常用方法
1、執(zhí)行sql語句,返回受影響的int數(shù)值。
dbContext.Execute("sql?執(zhí)行語句")
2、查詢數(shù)據(jù)庫,返回IEnumerable<dynamic>類型。
dbContext.SqlQuery("sql查詢語句")
....
DataBaseContext對象有很多方法,這里不一一贅述,有興趣的請下載PageAdmin.Utils源碼文件自行查看。
日期:2019-04 瀏覽次數(shù):3145
日期:2019-04 瀏覽次數(shù):3120
日期:2019-04 瀏覽次數(shù):3029
日期:2019-04 瀏覽次數(shù):2856
日期:2019-04 瀏覽次數(shù):2946
日期:2019-04 瀏覽次數(shù):3112
日期:2019-04 瀏覽次數(shù):3048
日期:2019-04 瀏覽次數(shù):3310
日期:2019-04 瀏覽次數(shù):3361
日期:2019-04 瀏覽次數(shù):3013
日期:2019-04 瀏覽次數(shù):3390
日期:2019-04 瀏覽次數(shù):2811
日期:2019-04 瀏覽次數(shù):2955
日期:2019-04 瀏覽次數(shù):3072
日期:2019-04 瀏覽次數(shù):2923
日期:2019-04 瀏覽次數(shù):3367
日期:2019-04 瀏覽次數(shù):3267
日期:2019-04 瀏覽次數(shù):2947
日期:2019-04 瀏覽次數(shù):3171
日期:2019-04 瀏覽次數(shù):3005
日期:2019-04 瀏覽次數(shù):2776
日期:2019-04 瀏覽次數(shù):3083
日期:2019-04 瀏覽次數(shù):2972
日期:2019-04 瀏覽次數(shù):3072
日期:2019-04 瀏覽次數(shù):3023
日期:2019-04 瀏覽次數(shù):2895
日期:2019-04 瀏覽次數(shù):2749
日期:2019-04 瀏覽次數(shù):2766
日期:2019-04 瀏覽次數(shù):2828
日期:2019-04 瀏覽次數(shù):2853
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.