Questions tagged [submitchanges]

Computes the set of modified objects to be inserted, updated, or deleted, and executes the appropriate commands to implement the changes to the database.

Computes the set of modified objects to be inserted, updated, or deleted, and executes the appropriate commands to implement the changes to the database.

Read more in: DataContext.SubmitChanges Method.

103 questions
0
votes
2 answers

Issue with Updating Changes in LINQ

I'm having an issue with updating the database. The app shows the updated value, but the database does not. No errors returned. My table has a PK. Using DotConnect for Oracle, but the LINQ syntax is the same. namespace ConsoleApplication1 { …
MAbraham1
  • 1,717
  • 4
  • 28
  • 45
0
votes
1 answer

LINQ DataContext inserts object that is not attached

I have created two separate objects, one of class Order and one of class TempOrder. When I try to insert the TempOrder object in the db using db.TempOrders.InsertOnSubmit(obj) and then calling db.SubmitChanges the Order object gets submitted as…
gmakrygiannis
  • 360
  • 3
  • 14
0
votes
1 answer

how to insert single row from datagridview to Database, Linq-to-Sql

I'm trying to insert a row from my datagridview to database, which is newly created. First I use ; db.recordTable.InsertOnSubmit(); however it requires db.SubmitChanges(); to make changes permanent. However db.SubmitChanges(); submits all changes…
BarisY
  • 171
  • 2
  • 4
  • 14
0
votes
1 answer

"Row Not Found or Changed" Error Pops Up Randomly

When I run DB.SubmitChanges(); I occasionally get an error that reads: "Row not found or changed". The reason why this error bugs me so much is because there will always a row that should be found for this query, and changes are only made if there…
sooprise
  • 22,657
  • 67
  • 188
  • 276
0
votes
1 answer

Changes not visible on table data

I would like to perform a transaction by using LINQ and SQL Server CE. The SubmitChanges method seems to work fine. But if I look in the data table the changes are not applied. My code: var query = (from s in this.tblRequirements where s.abbrevation…
ANKH
  • 3
  • 3
0
votes
1 answer

Using Linq2Sql to check an update

I am writing a small application in C# using Linq2SQL and because of the data this application will be updating and deleting I would like perform the queries much like you can within SSMS where you have a Begin Transaction in the beginning and a…
mattgcon
  • 4,768
  • 19
  • 69
  • 117
0
votes
2 answers

Linq To Sql - DataContext.SubmitChanges() problem

I have a code like this. DBContext is Datacontext instance. try { TBLORGANISM org = new TBLORGANISM(); org.OrganismDesc = p.Subject; DBContext.TBLORGANISMs.InsertOnSubmit(org); …
Ahmet Altun
  • 175
  • 1
  • 11
0
votes
2 answers

SubmitChanges doesn't save but removes inserts from change set, no errors

I have a deeper question regarding debug functionality of Linq to Sql SubmitChanges() Function. I want to save a record in a table of a locally cached db (localdbcache: server SqlExpress 2008 client SqlCE). Before calling SubmitChanges I can find…
0
votes
2 answers

Linq2Sql Not Updating Changes

I am using Linq2Sql to update a row data but once I change the values I've researched this issue before and found the following possible reasons: Entity was not changed so no update occurs Entity is missing a primary key but no update occurs None…
Only One
  • 1
  • 2
0
votes
1 answer

SubmitChanges not updating

First of all I would like to precise that I read all the related subjects about SubmitChanges issues but couldn't find anything solving my problem... I have several tables which are working perfectly fine using the same way (excepting composite…
Flash_Back
  • 565
  • 3
  • 8
  • 31
0
votes
1 answer

Error when Submitting a list of an objective

I got this error when I go to submit the object from a list in MVC 5, and it is always happening in the second item of list I use this to call the database method; foreach (var modulo in _Modulos) { USERS_MODULO _modulo = new USERS_MODULO(); …
0
votes
2 answers

In which layer to make linq-sql calls as SubmitChanges(), InsertOnSubmit() etc

Which layer is the best layer to make linq-sql calls as SubmitChanges(), InsertOnSubmit() etc. For example, let's say I have two tables Parent and Child. Child table has foreign key on parent (Child table has ParentId column). I want to insert…
hIpPy
  • 4,649
  • 6
  • 51
  • 65
0
votes
1 answer

How do you make SubmitChanges only submit a particular change and not all previous changes?

The ASP.NET linq SubmitChanges method commits changes for all previous database modifications since the last time it was called. I have a case where I do something like the following: ClassX x = new…
Petras
  • 4,686
  • 14
  • 57
  • 89
0
votes
0 answers

Windows Phone 8 - exception while Submit Changes

I have a problem with local database in Windows Phone 8 app. It's my DatabaseManager and Models public class DatabaseManager : DataContext { // Specify the connection string as a static, used in main page and app.xaml. public static string…
piotrbalut
  • 857
  • 1
  • 9
  • 21
0
votes
2 answers

Does deleting from a LINQ DB also delete records in other tables that have a foreign key association?

So at the root of my DB, I have a table "Customer." Customer has foreign keys going to about 6-7 other tables such as Receipts, Addresses, Documents etc. If I were to delete a customer using SubmitChanges(), would that seek out all those records…
Justen
  • 4,859
  • 9
  • 44
  • 68