Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Friday, December 02, 2011

Update ListItem into SharePoint List using Server side code.


SPWeb currentWeb = SPContext.Current.Web;
SPList lstLogin = currentWeb.Lists["Login"];
SPListItemCollection myColl = lstLogin.Items;
foreach (SPListItem item in myColl)
{
       if (item["UserName"].ToString() == txtUserName.Text)
       {
              item["PassWord"] = txtPassWord.Text;
              item.Update();
              lblMessage.Text = "Updation Successful";
              Clear();
              break;
       }
}

No comments:

Post a Comment