Wednesday, May 4, 2016

to delete the data in dataset

for (int tableno = 0; tableno < dsSMS.Tables.Count; tableno++)
                                {
                                    foreach (DataRow dr in dsSMS.Tables[tableno].Rows)
                                    {
                                        if (dr["ID"].ToString().Trim() == "24")
                                        {
                                            dr.Delete();
                                        }
                                    }
                                    dsSMS.Tables[tableno].AcceptChanges();
                                }

No comments:

Post a Comment