开发者

linq SubmitChanges method isn't working

I am using a simple code as follows:

        DataCla开发者_开发问答sses1DataContext context = new DataClasses1DataContext();

        order oder = context.orders.Single(p => p.order_no == 3);

        oder.ship_to_name = "test rana";
        context.SubmitChanges();  

However data isn't saving to sqlserver db. What have i missed? I have been trying basic linq tutorial

Regards


Does the orders table have a primary key? If not, then you wouldn't be able to perform updates.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜