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
1
vote
0 answers

sqlite Exception Identity Issue

I'm getting this error when the program executes mainDb.SubmitChanges(): INSERT INTO projects VALUES (@p0) SELECT CONVERT(Int, SCOPE_IDENTITY()) AS [value] -- @p0: Input String (Size = 0; Prec = 0; Scale = 0) [test2] -- Context: SqlProvider(Sql2008)…
Arkan
  • 579
  • 1
  • 6
  • 20
1
vote
2 answers

Linq SubmitChanges() function - when to call?

When manipulating data using Linq, how often does the SubmitChanges() method have to be called? In my project, there are a few tables related with foreign keys. In the creation SQL, these foreign keys are constrained so a record that is part of a…
Greg
  • 21,235
  • 17
  • 84
  • 107
1
vote
1 answer

LINQ DeleteOnSubmit: will deleted record be shown in next queries before submit?

I've have implemented a nested data set model to show a hierarchy in my database. So for deleting leaf nodes, after removing nodes, I will shift nodes left by 2. Implementing this idea in C# I developed this code: private void…
VSB
  • 9,825
  • 16
  • 72
  • 145
1
vote
1 answer

Updating with Linq-2-Sql: Editing private fields doens't trigger update, editing public properties does. Why?

I'm creating an edit-page for a user's profile in C# with MVC. As goes with these sort of pages, I get the information out of my database and display it in a form, and let the user change the fields to his/her liking. After the validation, I…
Bjorn De Rijcke
  • 653
  • 10
  • 23
1
vote
1 answer

SubmitChanges() updates database in bin folder

My code and the Linq to sql function SubmitChanges are working, but when using a local database a copy of the database in the bin folder is updated and not the primary database. So the changes aren't shown on a new query. If I re-connect the…
Zeus
  • 1,496
  • 2
  • 24
  • 53
1
vote
2 answers

LINQ to SQL - How do stored procedures interact with unsubmited datacontext changes?

Someone here asked: "Linq-To-Sql enables calling SPs. If this SP executes an update/delete/insert, do I need to SubmitChanges() after it?" And the answer was: "No you don't. The code will work. Submit changes is only concerned with modified LINQ to…
1
vote
1 answer

SubmitChanges call not updating data

The last few hours I'm trying to find out why I'm not able to update the data in the db using the SubmitChanges method. I'm able to retrieve data normally but when I'm calling the SubmitChanges method, the call is executing like for 5+ minutes,…
Laziale
  • 7,965
  • 46
  • 146
  • 262
1
vote
1 answer

how to get callback for telerik grid submitChanges method

I am calling telerik Grid's grid.submitchanges()(FUNCTION1) in javascript which is an async call and there is one ajax synchronous callback (FUNCTION2) after FUNCTION1. The problem is sometimes FUNCTION2 is getting executed before the completion of…
1
vote
1 answer

.SubmitChanges() in LINQ to SQL does not work

I'm having a problem updating an item using Linq to SQL in WP8. When I run the code, the Object gets updated fine when going trough the app. However, as soon as I leave the app, the update gets lost. It seems that .SubmitChanges() does not work.…
Misja
  • 91
  • 1
  • 6
1
vote
2 answers

LINQ context SubmitChanges

Regarding the SubmitChanges order (Insert, Update, Delete), is there a way to change that order? I need to have the Deletes executed first, any updates, then any new inserts. I have a datagrid where the user can do all add, changes and updates and…
Ed.
  • 11
  • 1
1
vote
1 answer

can't insert new row into a child table with submit changes in a linq to sql app

I can't figure out the correct way to insert a new record in a child table. There's a single datacontext in the app and the target table (CustNotes) is a child of a table named Customer. There's a one to many association between Customer and…
Jack McG
  • 595
  • 2
  • 6
  • 5
1
vote
1 answer

“A cycle was detected in the set of changes” with Linq to SQL

I am currently developing an application in which i experience the exception "A cycle was detected in the set of changes" when calling DataContext.SubmitChanges(). I know why this exception is thrown but i have not been able to find a fix for my…
retanik
  • 174
  • 12
1
vote
2 answers

LINQ to SQL - retrieve object, modify, SubmitChanges() creates new objects

I've been battling this for a while. I'm trying to implement a many to one association. I have a bunch of rows in a table, called readings. These accumulate over time, and every now and then I want to export them. When I export them I want to create…
hitch
  • 291
  • 1
  • 3
  • 10
1
vote
1 answer

C# Linq-to-SQL Error on submitChanges()

I have a silly problem with Linq to SQl. I only work with C# for 3 weeks but I thought I understand it. So, now I´m testing my classes (Entites and Manage classes for them) but I get in the initialization of the testclasses an…
Jastol
  • 165
  • 3
  • 12
1
vote
1 answer

Simple Linq to SQLIte application hangs on SubmitChanges()

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.SQLite; using System.Data.Linq.Mapping; using DbLinq.Data.Linq; namespace LinqToSQLite { class Program { static void…