Link to home
Start Free TrialLog in
Avatar of manivineet
manivineet

asked on

cannot update value - LINQ

I want update a property in a table (i' am using MS SQL server database) , but it get this error
" THIS PROPERTY IS READONLY"

how do i fix this?

also when I declare  a new linq database instance,
Dim Db As New SageEMSArchiveDataContext
I only get 4 overidable properties (normally this is 5)

I have
import  system.linq

I have checked my references, also stangely another project(on my system) does not have this issue.

any idea why this happens?




Dim Db As New SageEMSArchiveDataContext("Data Source=ADELN250;Initial Catalog=SageEMS;Integrated Security=True")
 
        Dim tbFile = (From files In Db.tbFiles _
                   Select files.Filename, files.ArchiveLocation Where Filename = fName).ToList(0)
 
        If Not tbFile Is Nothing Then
            tbFile.ArchiveLocation = "asdf" 'AT THIS POINT I GET AN ERROR SAYING THAT THIS PROPERTY IS READONLY
        End If

Open in new window

Avatar of Sreedhar Vengala
Sreedhar Vengala
Flag of Australia image

Avatar of manivineet
manivineet

ASKER

no that didn't help at all
ASKER CERTIFIED SOLUTION
Avatar of naspinski
naspinski
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
well the problem was that my table didn't have primary key.