1. 程式人生 > >Dapper where Id in的解決方案

Dapper where Id in的解決方案

簡單記一下,一會出去有點事情~

我們一般寫sql都是==》update NoteInfo set [email protected] where NId in (@NIds)

Dapper生成的sql是:

也就自然出錯了:

簡單修改一下:

int i = await NoteInfoBLL.ExecuteAsync("update NoteInfo set [email protected] where NId in @NIds", new
{
  NDataStatus = status,
  NIds = ids.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)


});

Dapper生成sql:(型別再轉換一下就ok了,這邊只是說下方法,先閃了)

exec sp_executesql N'update NoteInfo set [email protected] where NId in (@NIds1,@NIds2,@NIds3)',N'@NDataStatus int,@NIds1 nvarchar(4000),@NIds2 nvarchar(4000),@NIds3 nvarchar(4000)',@NDataStatus=99,@NIds1=N'1',@NIds2=N'2',@NIds3=N'3'

相關推薦

Dapper where Id in解決方案

簡單記一下,一會出去有點事情~ 我們一般寫sql都是==》update NoteInfo set [email protected] where NId in (@NIds) Dapper生成的sql是: 也就自然出錯了: 簡單修改一下: int i = await N

關於linux釋出tomcat啟動慢:Creation of SecureRandom instance for session ID解決方案

linux或者部分unix系統提供隨機數裝置是/dev/random 和/dev/urandom ,兩個有區別,urandom安全性沒有random高,但random需要時間間隔生成隨機數。 可能在生成隨機數的時候卡住了,導致tomcat啟動不了/ 解決辦法: 開啟$JAVA_HOME/jr

nios ii 時間戳不對或者ID不對解決方案

2018年11月03日 12:57:04 DuguLengfeng666 閱讀數:7 個人分類: FPGA

JAVA平臺分散式自增長ID解決方案分析對比

JAVA平臺分散式自增長ID 的解決方案分析對比 全域性ID解決方案一: redis Redis的incr自增函式來維護全域性ID,設計的關鍵地方: 1. key的長度;長度影響效率和儲存容量 2. key的命名規則:無規則,維護困難,不能見名知意,瞭解所屬業務板塊 3. 需要人

醉了,mysql的刪除居然變得這麼麻煩 delete from table where id in()

居然要加這麼多層,還需要在裡面加一個別名才可以。 刪除標題重複的舊記錄。 delete from theTable where id in ( select id from ( select min(id) id from theTable group by t

阿里雲伺服器linux(Centons7)下使用nginx配置https報錯nginx: [emerg] unknown directive "ssl" in解決方案

報錯資訊:nginx: [emerg] unknown directive "ssl" in /usr/local/devtool/nginx-1.6.2/conf/nginx.conf:103 錯誤截圖: 解決方案: 1、在第一次解壓對目錄中執行如下命令 .

MySQL 查詢 select * from table where id in 如何提高效率?

例句:select * from a where id in (select id from b );對於這條sql語句它的執行計劃其實並不是先查詢出b表的所有id,然後再與a表的id進行比較。mysql會把in子查詢轉換成exists相關子查詢,所以它實際等同於這條sq

Oracle數據庫查詢用 where in 查詢的項超過1000條的解決方案

ont rac ipc ram take list() nbsp con || 眾所周知,如果我們的用SQL查詢語句時,如果用where in帶的參數超過1000條的話,oracle是會報錯的。 因為項目中遇到這樣的問題,所以找到了接下來我要說的這個辦法。 因為用的地方很多

ibatis/mybatis出現 sql 語句 where in(引數1,引數2……引數1000) 超過1000個引數時候的解決方案

公司專案出現bug,查詢後是由於sql 語句in()內參數查過1000引起的 由於專案比較大,無法輕易修改或重構。 公司框架比較老用了ibates  無法從xml配置裡進行修改。所以本人寫了段程式碼

mysql Column 'dbvalue' in where clause is ambiguous解決方案

在一次使用mysql資料庫查詢的時候出現錯誤提示 Column 'languageid' in where clause is ambiguous,這個錯誤in where clause is amb

Unknown column 'rownum' in 'where clause'解決方案

Unknown column 'rownum' in 'where clause',當在巢狀的查詢語句裡面用到rownum的時候會遇到這個問題,比如: SELECT * FROM  (select t.id,t.name from USER_INFO t where t.s

python 編碼問題:'ascii' codec can't encode characters in position 的解決方案

解釋器 rac python 編碼 att 文件 tde pla pytho net 問題描述: Python在安裝時,默認的編碼是ascii,當程序中出現非ascii編碼時,python的處理常常會報這樣的錯UnicodeDecodeError: ‘ascii‘ co

Plugin with id 'com.novoda.bintray-release' not found.的解決方案

添加 pan mage nbsp file eas 分享 pat img import Module的時候,有時候會提示Plugin with id ‘com.novoda.bintray-release‘ not found. 點擊Open File,定位到該Mod

外顯子分析彈錯解決方案:Exception in thread "main" picard.PicardException: New reference sequence does not contain a matching contig for NC_007605

clear except -c 解決 als index false quest div 最近從公共數據庫下載了一堆bam文件和reference 基因組文件,重新分析外顯子流程時,跑出了“Exception in thread "main" picard.Pi

Eclipse中使用git提交代碼,報錯Testng 運行Cannot find class in classpath的解決方案

testng 打開 解決 not find src tro 刪除 運行 logs 一、查找原因方式 1.點擊Project——>Clear...——>Build Automatically 2.查看問題 二、報錯因素 1.提交.xlsx文件 2.提交時,.

Spring Boot:Action:Consider defining a bean of type '*.*.*' in your configuration解決方案

rri framework 成功 ould script ota http per apache   果然不看教程直接使用在遇到問題會懵逼,連解決問題都得搜半天還不一定能幫你解決了。。。 ***************************APPLICATION FAIL

QT常見問題一:VS打開QT解決方案,Qt Visual StudioAdd-in插件報錯誤

vs打開 51cto pro alt 方案 ces 解決 方法 重新編譯 VS打開工程報錯,具體如下圖所示:解決方法如下圖所示:①VS菜單選擇Qt5,點擊Qt Project Settings項 ②在Qt項目配置窗口,Properties頁,配置自己需要使用的QT版本根據自

python 網絡爬蟲報錯“UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position”解決方案

accept wid python3 header style 設置方法 能夠 error: posit Python3.x爬蟲, 發現報錯“UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0x8b in positi

關於discuz註冊時出現用戶ID已被占用的解決方案

roc img images 關於 解決方案 php dmi 兩個 問題 解決discuz會員註冊提示提示:用戶 ID 已經被占用”方法,用春哥技術博客團隊提供這個教程可以解決從老版本或者升級後提示用戶 ID 已經被占用”等。還有搬家以後出現的這種問題。 問題如圖: 在di

Server 2012 R2 SceCli 事件ID:1202( 0x534)解決方案

錯誤 ppp 51cto nta note image change ask tro 報錯如下:Log Name: Application Source: SceCli Date: 10/28/2018 4:03:07 PM Event ID: 1202 Task Cate