c# 使用 mssql sqlbulkcopy 寫入資料表,出現以下exception:
System.InvalidOperationException: 'The given value of type String from the data source cannot be converted to type nvarchar of the specified target column.'
大意是:要寫入table的字串內容,其長度大於table欄位長度規格。
解決方式:逐一檢視要寫入的字串內容和其對應的table長度規格,table長度不夠的做調整即可。
沒有留言:
張貼留言