views:

154

answers:

1

New day, new problem :-)

Code:
Client Side:

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);
        }
    }

Server side service code:

[OperationContract]
public void SaveBlob(Blob blob)
{
    try
    {
        RichTekstModelDataContext dc = new RichTekstModelDataContext();
        dc.Blobs.InsertOnSubmit(blob);
        dc.SubmitChanges();
    }
    catch (Exception ex) { string s = ex.Message; }
}

The problem: When I am trying to save blobs with Content field smaller than 3mb it works perfectly, but when blob exceedes 3 mb, I am getting "Not found" exception (---> error line) in Refernece.cs file

public void EndSaveBlob(System.IAsyncResult result) {
    object[] _args = new object[0];

----> base.EndInvoke("SaveBlob", _args, result); }

I have no idea how to fix it. I have set in web.config apropriate buffers sizes, but stil it doesn't work.

Thanks for help.

A: 

OK. I have found a solution:

link to solution:

http://silverlight.net/forums/p/18162/61547.aspx

Michal Krawiec
Great, glad I could help
Chad Grant