473,320 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Toggle

Hello,

I need to set the property IsActive = false for all records but one
which has FileID = id

database.Files.Select(p =p.FileID != id)

I am selecting the records ... I just don't know how to change the
IsActive of all this records to false.

If possible using lambda.

Thanks,
Miguel
Nov 18 '08 #1
3 1848
On Nov 18, 11:25*pm, shapper <mdmo...@gmail.comwrote:
Hello,

I need to set the property IsActive = false for all records but one
which has FileID = id

database.Files.Select(p =p.FileID != id)

I am selecting the records ... I just don't know how to change the
IsActive of all this records to false.

If possible using lambda.

Thanks,
Miguel
I also tried:
database.Files.Where(p =p.FileID != id).Select(p =p.IsActive =
false);

But I get an error:
An expression tree may not contain an assignment operator
Nov 18 '08 #2
On Tue, 18 Nov 2008 15:25:31 -0800, shapper <md*****@gmail.comwrote:
Hello,

I need to set the property IsActive = false for all records but one
which has FileID = id

database.Files.Select(p =p.FileID != id)

I am selecting the records ... I just don't know how to change the
IsActive of all this records to false.

If possible using lambda.
Not directly, no. For some reason, there's no "ForEach()" method in the
Enumerable class.

But, you can certainly just write a foreach() loop and do it explicitly.

Pete
Nov 18 '08 #3
On Nov 18, 11:45*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Tue, 18 Nov 2008 15:25:31 -0800, shapper <mdmo...@gmail.comwrote:
Hello,
I need to set the property IsActive = false for all records but one
which has FileID = id
database.Files.Select(p =p.FileID != id)
I am selecting the records ... I just don't know how to change the
IsActive of all this records to false.
If possible using lambda.

Not directly, no. *For some reason, there's no "ForEach()" method in the *
Enumerable class.

But, you can certainly just write a foreach() loop and do it explicitly.

Pete
Thank You Pete,
Miguel
Nov 19 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: leegold2 | last post by:
I wondered if anyone would give me code- I think it would be easy, but I'm a complete newbie. What I want to do is to show many tables in a brief truncated format and then for each table offer the...
11
by: MLH | last post by:
Why is that? If I choose the tiny check boxes which are hard to hit with a mouse, it works fine. But option buttions, shich can be sized big enough for people with limited sight and dexterity...
4
by: Neil Coleclough | last post by:
I am constructing a database to process product returns for my Company. I have a number of toggle buttons to identify the stage to which each return has been processed. For example, clicking the...
5
by: Steven | last post by:
Can anyone tell me how to toggle the "Caps Lock" key? Thanks in advance
50
by: sksoule | last post by:
Hi, Can anyone please tell me how to toggle a nth bit. For example, I am having a variable which is of 8 bits. I want to toggle the nth bit. Regards, Santosh
1
by: barbalu | last post by:
Hello. I'm painfully new to this and am having trouble figuring out what I'm doing wrong... I have two small tables in a simple html file. I want each table to have the ability to collapse/expand...
3
by: Killer42 | last post by:
Hi all. I have a frame with some toggle buttons in it. All is working fine, except that the user can't tell which option is selected to begin with. How do I set one of the toggle buttons to the...
1
by: swiftouch | last post by:
I'm getting an error message in FF2.0: document.getElementById(toggle) has no properties The goal of the script is, when I hover my mouse over an image, to make one div element visible while...
0
by: ARC | last post by:
Hello all, In access 2007, it appears you cannot put a toggle button underneath a menu id and have it show a Pressed / Not Pressed status. If you make the toggleButton ID as part of the main...
4
by: ameshkin | last post by:
I have a checkbox with an ID of svc_tp_1, and an image that corresponds with this checkbox below it. <input type="checkbox" name="checkbox" id="svc_tp_1" value="svc_tp_1" / <img...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.