我試圖挽救FileUpload控件圖像到數據庫大小限制超過
public Byte[] bytes;
Stream fs = FileUpload1.PostedFile.InputStream;
BinaryReader br = new BinaryReader(fs);
bytes = br.ReadBytes((Int32)fs.Length);
SqlDataSource2.Update();
protected void SqlDataSource2_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
e.Command.Parameters["@project_file"].Value = bytes;
}
我的數據庫project_file
字段設置爲varbinary(MAX)
,
但它拋出一個錯誤
參數'@project_file'超出sql_variant數據類型的大小限制。
請提出一些解決方案
你縮進代碼的方式是......創意。 ;-) – Heinzi