Manish Tiwari
Manish Tiwari

Reputation: 1866

How to run `select` statement along with `where` using Lambda Expression in Asp .Net c#?

I am running Select Statement along with Where condition but it gives me 0 data.

Code :

            public ActionResult ExportReport(int uid)
            {
                GridView gv = new GridView();
                gv.DataSource = db.tbl_demo.Where(x => x.UID == uid).
                                Select(x=> new { CustomerName = x.CUST_NAMER,ID=x.UID})
                                .FirstOrDefault();
             }

Upvotes: 1

Views: 85

Answers (1)

amirhamini
amirhamini

Reputation: 536

Your Code Statement has no problem Check Your DBContext Code Configuration

Upvotes: 1

Related Questions