我试图挽救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