C# 通过linq向sql插入超过3mb的图像
新的一天,新的问题:-) 代码:C# 通过linq向sql插入超过3mb的图像,c#,.net,silverlight,linq-to-sql,.net-3.5,C#,.net,Silverlight,Linq To Sql,.net 3.5,新的一天,新的问题:-) 代码: 客户端: void abw_Closed(object sender, EventArgs e) { DbServiceClient sc = new DbServiceClient(); abw = (AddBlobWindow)sender; fi = ((AddBlobWindow)sender).fi; if ((bool)((AddBlobWindow)sender).DialogResult) {
客户端:
void abw_Closed(object sender, EventArgs e)
{
DbServiceClient sc = new DbServiceClient();
abw = (AddBlobWindow)sender;
fi = ((AddBlobWindow)sender).fi;
if ((bool)((AddBlobWindow)sender).DialogResult)
{
blob = new Blob();
binBlob = new Binary();
binaryBlob = new byte[fi.Length];
int n = fi.OpenRead().Read(binaryBlob,0,Convert.ToInt32(fi.Length));
binBlob.Bytes = binaryBlob;
blob.Content = binBlob;
blob.Signature = abw.tbSignature.Text;
blob.Size = (int)fi.Length;
sc.SaveBlobCompleted += new EventHandler<AsyncCompletedEventArgs>(sc_SaveBlobCompleted);
sc.SaveBlobAsync(blob);
}
}
问题是:
当我试图保存内容字段小于3mb的blob时,它工作得很好,但当blob超过3mb时,我在referenece.cs文件中遇到“找不到”异常(->错误行)
public void EndSaveBlob(System.IAsyncResult result) {
object[] _args = new object[0];
---->EndInvoke(“SaveBlob”,参数,结果);
}
我不知道如何修理它。我在web.config中设置了适当的缓冲区大小,但仍然不起作用
谢谢你的帮助。好的。我找到了一个解决方案: 链接到解决方案:
public void EndSaveBlob(System.IAsyncResult result) {
object[] _args = new object[0];