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
1 answer

Linq-to-SQL SubmitChanges not updating physical database

I am new here and only signed up because I desperately need the solution to my problem. I have a VB.NET project that is using a local .MDF file that I have imported into my project. The primary keys are intact so I know that isn't my issue. I am…
salce
  • 409
  • 1
  • 12
  • 28
1
vote
1 answer

Check during typing in jquery, not after blur

I have a small problem that is probably easy to fix, but I'm not that good yet. I have written this simple code $(document).ready(function(){ $('#email').change(function(){ var regexp = /^\w+[@]\w+\.\w{2,4}$/; …
Piotr Ciszewski
  • 1,691
  • 4
  • 30
  • 53
1
vote
2 answers

Using Linq SubmitChanges without TimeStamp and StoredProcedures the same time

I am using Sql tables without rowversion or timestamp. However, I need to use Linq to update certain values in the table. Since Linq cannot know which values to update, I am using a second DataContext to retrieve the current object from database and…
Mephisztoe
  • 3,276
  • 7
  • 34
  • 48
0
votes
2 answers

GetChangeSet ChangeSet, Linq what order will changes be applied?

I am running the code to get the change set just before a linq submit changes call. private void OnSubmitHandleReplication() { System.Data.Linq.ChangeSet changes = GetChangeSet(); //Do something with change set } In the do something section…
Anthony D
  • 10,877
  • 11
  • 46
  • 67
0
votes
1 answer

MVC3 LINQ SubmitChanges Invalid

In the method below db.SubmitChanges is shown as invalid/not recognized by intellisense. This is my first attempt to update records in a database using LINQ and the method may contain other logic/syntactical errors that I havent yet uncovered as…
HendPro12
  • 1,094
  • 3
  • 17
  • 50
0
votes
1 answer

ObjectStateManager and Detached entity state

I'm using Entity Framework and some parts of its functionality are still unclear for me. The main things that are hard to understand are: SubmitChanges process; Order of invoking update-delete-insert methods; Understanding of…
0
votes
1 answer

Checking restrictions on insert or submit of linq-to-sql items to db

I would like to implement checking of object data when inserting or submitting the object to sql. Is there some OnInsert or OnSubmit function that I could implement/extend for the automatically generated linq-to-sql-classes, or some other…
tomsv
  • 7,207
  • 6
  • 55
  • 88
0
votes
1 answer

ASP.NET MVC3 C# - not all code paths return a value

I'm almost there with this loop! Controller: // Hide 'posts' [AcceptVerbs(HttpVerbs.Post)] public ActionResult Hide (int id) { var post = db.tb_SH_Forum_Posts.Single(p => p.Post_ID == id); post.Private_ID =…
Amy
  • 71
  • 6
0
votes
1 answer

Linq to SQL SubmitChanges() not working if textbox modified by listbox

In a simple test form, I have a listbox and a textbox. The form is bound to a datacontext, which has a single table. The listbox has two items, and is not bound. The textbox is bound to the datacontext. When I select an item from the listbox, the…
DanW52
  • 67
  • 7
0
votes
3 answers

In a datacontext are inserted values not available within the datacontext until after submitchanges?

I'm going through an XML file of articles and the journalist(s) that wrote them. As we are adding the articles into _Data our datacontext we may come across a journalist that needs adding so we do this: newJourno = New journalist With {.name =…
0
votes
3 answers

data context SubmitChanges() exit's code without exception - deployed .net mvc on iis5.1

I have just deployed my first application in .NET MVC and i'm having issues. I have resolved the iis 5.1 problems with the routing (If anyone is looking for this go here:…
Andrew
  • 9,967
  • 10
  • 64
  • 103
0
votes
1 answer

Silverlight 4 wcf ria Saving multiple records

Ok, I'm pretty sure its just a matter of learning... but I have a very normalized db i'm working with so when I save to my product tbl I also have a productDollar tble and so on... my question is in silverlight everything is async so How do I save a…
0
votes
0 answers

Linqpad: how to get SQL output without actually executing the query?

I've a small program in Linq that inserts records in my database based on a number of conditions (depending on existing data in the same db). The SQL output are lots of SELECT and INSERT statements. In my production environment this should be…
BTC
  • 2,975
  • 1
  • 19
  • 25
0
votes
2 answers

LINQPad "The name SubmitChanges does not exist"

Working with LINQPad 5 on virtual machine win 10. Select queries work, now I try to use update query and it gives me an error about SubmitChanges() method. CS0103 The name 'SubmitChanges' does not exist in the current context. Basically all…
Michael Snytko
  • 327
  • 3
  • 13
0
votes
1 answer

How to catch SqlException in LINQ to SQL

In my WPF application, I'm using LINQ to SQL, so when I call SubmitChanges(), it throws an exception, but I'm unable to catch it. Here is the relevant code: try { FeatureDataContext.Features.InsertOnSubmit(newFeature); …
Nawaz
  • 353,942
  • 115
  • 666
  • 851