开发者

DataRow which is added is not going to be delete doing table.Rows[i].Delete()?

Why is that? The state of the datarow is added. When I delete the row the开发者_运维问答 state is unchanged. Why not deleted? That's the reason my Delete Store Procedure is never called!

edit: the datarow is freshly added and then I try to delete it.


show your code please. my test shows that everything works fine:

        DataTable dt = new DataTable();
        DataRow dr = dt.NewRow();
        dt.Rows.Add(dr);
        Console.WriteLine(dr.RowState);
        dr.Delete();
        Console.WriteLine(dr.RowState);

output is:

        Added
        Detached
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜