0
我有一個由xml標記組成的字符串,我用UTF8編碼。當我將它插入到sql server映像文件中時,它只會插入前28個字節或字符。從c#插入UTF8數據到sql server 2005中的圖像字段#
這裏是我的代碼:
UTF8Encoding utf8 = new UTF8Encoding();
byte[] encodedBytes = utf8.GetBytes(file.Value);
string update = String.Format("Update xdpath set content = '{0}' where dpath = '{1}';", encodedBytes, file.Key);
SqlCommand com = new SqlCommand(update, conn);
com.ExecuteNonQuery();
結果類型的圖像內容領域:0x53797374656D2E427974655B5D。
該文件中有非常詳細的內容。請幫忙。
Thankssss這麼多。 –