From: Paul on
Hi,

Haw can i do this in linQ:
UPDATE Table SET Field1="Value" WHERE idTable==5

Thanks
From: Martin Honnen on
Paul wrote:

> Haw can i do this in linQ:
> UPDATE Table SET Field1="Value" WHERE idTable==5

What are you using exactly, LINQ to SQL, LINQ to Entities?
For LINQ to SQL see
http://msdn.microsoft.com/en-us/library/bb399339(v=VS.90).aspx

--

Martin Honnen --- MVP Data Platform Development
http://msmvps.com/blogs/martin_honnen/
From: Patrice on
Hi,

> Haw can i do this in linQ:
> UPDATE Table SET Field1="Value" WHERE idTable==5

Linq to SQL or EF ?

It's best to forget about Sql. It allows to expose your data as *objects* so
you just update the object instance and you call the SaveChanges method (or
SubmitChanges if Linq To SQL).

See :

http://msdn.microsoft.com/en-us/library/bb386870.aspx and around for details
if Linq To EF...

If you have a particular problem in using the doc, you may want to be more
explicit about the issue you ran into...

--
Patrice
> Thanks
>

From: Mr. Arnold on
Paul wrote:
> Hi,
>
> Haw can i do this in linQ:
> UPDATE Table SET Field1="Value" WHERE idTable==5
>
> Thanks

You have to query for the object out from whatever table it is by
idtable == 5.

You make changes obj.Field1 = '2';

Context.Savechanges();