Note:- Here Title is Primary Key.
var context = new LinqSampleDataContext(SPContext.Current.Web.Url);
foreach (LoginItem item in context.Login)
{
if (item.Title == txtUserName.Text)
{
context.Login.DeleteOnSubmit(item);
}
}
context.SubmitChanges();
this.Controls.Add(new LiteralControl("Record Successfully
Deleted"));
var context = new LinqSampleDataContext(SPContext.Current.Web.Url);
foreach (LoginItem item in context.Login)
{
if (item.Title == txtUserName.Text)
{
context.Login.DeleteOnSubmit(item);
}
}
context.SubmitChanges();
this.Controls.Add(new LiteralControl("Record Successfully
Deleted"));
No comments:
Post a Comment