?
Solved

LINQ - SubmitChanges() does not update field in DB

Posted on 2011-10-24
3
Medium Priority
?
873 Views
Last Modified: 2012-05-12
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

0
Comment
Question by:exceter
  • 2
3 Comments
 
LVL 3

Assisted Solution

by:BartVx
BartVx earned 400 total points
ID: 37022949
Hi Exceter,

the surrounding brackets make me suspect that you have this enclosed in a transaction? If this is the case, did you call Complete on the transaction?
0
 
LVL 3

Accepted Solution

by:
exceter earned 0 total points
ID: 37022995
The surrounding barckets are just a loop. I have not paste here a full code
0
 
LVL 3

Author Closing Comment

by:exceter
ID: 37158284
There was no solution, giving points for try
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question