Link to home
Start Free TrialLog in
Avatar of exceter
exceterFlag for Kyrgyzstan

asked on

LINQ - SubmitChanges() does not update field in DB

Hi, I am trying LINQ for the first time,
and it is of course making problem to me :)
It does not give error, I google a lot to find a solution.
And my table (MS SQL 2008) has a primary key.

 
try
                        {
                            DataClasses1DataContext db = new DataClasses1DataContext(KLIS.Helpers.myConnections.GetConnectionString());
                            //var IPs = from p in db.T_MRO_IPs select p;

                            T_MRO_IP mro = db.T_MRO_IPs.Single(p => p.id == id);
                            mro.lastReply = DateTime.Now;
                            db.SubmitChanges();
                            //DataTable dt = KLIS.Helpers.myConnections.GetDataTableText("UPDATE T_MRO_IP SET lastReply=" + date.);
                        }

Open in new window

SOLUTION
Avatar of BartVx
BartVx
Flag of Belgium 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
ASKER CERTIFIED SOLUTION
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
Avatar of exceter

ASKER

There was no solution, giving points for try