本文介紹了為什么我會(huì)得到“字符串或二進(jìn)制數(shù)據(jù)會(huì)被截?cái)?quot;?作為一個(gè)錯(cuò)誤?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
限時(shí)送ChatGPT賬號(hào)..
我對(duì)此有疑問:
字符串或二進(jìn)制數(shù)據(jù)將被截?cái)?em class="showen">
String or binary data would be truncated
這是我的編碼:
String savePath = @"C:UsersShenDesktopLenzOCRLenzOCRWindowsFormsApplication1ImageFile" + fileName;
inputImageBox.Image = Image.FromFile(ImageLocation);
inputImageBox.Image.Save(savePath);
String sqlData = "INSERT INTO CharacterOCR(ImageName, ImagePath, Character, CharacterDescription)
VALUES('"+fileName+"', '"+savePath+"', '"+typeName+"', '"+CharDesc+"')";
SqlCommand cmd = new SqlCommand(sqlData, con);
cmd.ExecuteNonQuery(); // <<<<<error indicates here
有什么問題?
推薦答案
查看表的架構(gòu)并查看最大長(zhǎng)度.您可能正在嘗試插入大于最大長(zhǎng)度的內(nèi)容.
Look at the schema of your table and look at the max lengths. You're probably trying to insert something larger than the max length.
這篇關(guān)于為什么我會(huì)得到“字符串或二進(jìn)制數(shù)據(jù)會(huì)被截?cái)?quot;?作為一個(gè)錯(cuò)誤?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!