Home All Groups Group Topic Archive Search About

Is it possible with Linq to update a dataset?

Author
28 Apr 2010 7:44 AM
BlackSun
Hi,
I have this working code which update a column:

For Each rigaFF As DataRow In Me.dtSizeA.Rows
    For Each rigaTemp As DataRow In
Me.dtSizeB.Select(String.Concat("Name = ", CStr(rigaFF(0))))
        rigaTemp(18) = rigaFF(3)
    Next
Next

Is it possible to do the same with Linq?

Thanks in advance for your help!!!

Cheers, BlackSuna

Author
28 Apr 2010 9:36 AM
Cor Ligthert[MVP]
AFAIK No.

if you want to use Linq for SQL Server (not other ones) have a look to Linq
to SQL or Linq to EF

It is easy with Linq to SQL, just add a Linq to SQL item and go than to
server explorer to select the tables like in AdoNet.

DataContext SubmitChanges does than the update.

(You can do normal Linq in a DataSet, but a dataset does not mean direct
AdoNet)



Show quoteHide quote
"BlackSun" <black_***@email.it> wrote in message
news:6fa7a31a-14d1-42ae-bc8a-596a2aad1a9b@r18g2000yqd.googlegroups.com...
> Hi,
> I have this working code which update a column:
>
> For Each rigaFF As DataRow In Me.dtSizeA.Rows
>    For Each rigaTemp As DataRow In
> Me.dtSizeB.Select(String.Concat("Name = ", CStr(rigaFF(0))))
>        rigaTemp(18) = rigaFF(3)
>    Next
> Next
>
> Is it possible to do the same with Linq?
>
> Thanks in advance for your help!!!
>
> Cheers, BlackSuna
>
Author
28 Apr 2010 6:01 PM
Michel Posseth [MCP]
Yes you can update a dataset with Linq  , just set a value to the entity

HTH

Michel

Show quoteHide quote
"BlackSun" <black_***@email.it> schreef in bericht
news:6fa7a31a-14d1-42ae-bc8a-596a2aad1a9b@r18g2000yqd.googlegroups.com...
> Hi,
> I have this working code which update a column:
>
> For Each rigaFF As DataRow In Me.dtSizeA.Rows
>    For Each rigaTemp As DataRow In
> Me.dtSizeB.Select(String.Concat("Name = ", CStr(rigaFF(0))))
>        rigaTemp(18) = rigaFF(3)
>    Next
> Next
>
> Is it possible to do the same with Linq?
>
> Thanks in advance for your help!!!
>
> Cheers, BlackSuna