How to use lamda expression for updating using LINQ

This is small example showing how we use lamda expression in the programming section , Generally we use lamda expression when working wiht LINQ , or the classs of list type where need to get the data based on any where clause.


public Boolean Update(string id)
{
int flag = 0;
string str = DateTime.Now.Day + "-" + DateTime.Now.Month + "-" + DateTime.Now.Year;
foreach (var c in obj.Task_Details.Where(x => x.task_no == id))
{
c.task_date = str;
flag = 1;
c.status = "Complete";
}
obj.SaveChanges();
if (flag == 1)
{
return true;
}
else
{
return false;
}
}

Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. can u please tell me ..how to create materialized view in sql server

    ReplyDelete
    Replies
    1. just write the select query generally touching the base table as materialized view is a view that contains the result of any query ..for example calling a data set on your local machine from a remote based database.
      for further references click the below link .
      http://social.msdn.microsoft.com/Forums/sqlserver/en-US/923ce3e3-432d-4377-b4bf-cc6edc7c07b2/materialized-view-in-sql-server?forum=transactsql

      Delete
  3. And can u tell me how to use ext.net to give dynamic effects using xaml

    ReplyDelete

Post a Comment

Popular posts from this blog

RichTextBox Field in power apps as Sharepoint online defalut forms.

Understanding Power App

Working on Web application? Remember these Points for the UI prespective !!