获取savechangeasync()的错误?

时间:2017-04-04 15:37:38

标签: c#

' proEntities'不包含' SaveChangesAsync'的定义没有扩展方法' SaveChangesAsync'接受第一个类型' proEntities'可以找到(你错过了使用指令或程序集引用)

    private async void button1_Click(object sender, EventArgs e)
    {
        using (proEntities db = new proEntities())
        {
            mypic prjt = new mypic() { filename = filename ,data = ConvertImageToBinary(pictureBox1.Image)};
            db.mypics.Add(prjt);
            await db.SaveChangesAsync();

            MessageBox.Show("successfully saved.", "message", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }

https://i.stack.imgur.com/XWI0o.jpg

0 个答案:

没有答案