submitchanges

How to get the TSQL Query from LINQ DataContext.SubmitChanges()

旧时模样 提交于 2019-12-29 03:31:10
问题 I'm using Linq to SQL. I have a DataContext against which I am .SubmitChanges()'ing. There is an error inserting the identity field, and I'd like to see the query it's using to insert this identity field. I don't see the query itself within the quickwatch; where can I find it from within the debugger? 回答1: There is actually a very simple answer to your question Just paste this in your watch window ((System.Data.Objects.ObjectQuery)myLinqQueryVar).ToTraceString() 回答2: Lots of people have been

Get p:selectOneRadio value to a JS function

蹲街弑〆低调 提交于 2019-12-25 14:22:52
问题 I have a PF's selectOneRadio to choose a file type to download. Also I have a commandButton to call a download servlet using onclick attribute. The problem is that when I choose file type and click the button, the chosen value is of course not yet submitted. I'm looking for some way to get the chosen value available when I click on a download button. Here's my code: <p:selectOneRadio id="sorType" value="#{bean.type}" layout="custom"> <f:selectItem itemLabel="XML" itemValue="XML" /> <f

Get p:selectOneRadio value to a JS function

て烟熏妆下的殇ゞ 提交于 2019-12-25 14:22:32
问题 I have a PF's selectOneRadio to choose a file type to download. Also I have a commandButton to call a download servlet using onclick attribute. The problem is that when I choose file type and click the button, the chosen value is of course not yet submitted. I'm looking for some way to get the chosen value available when I click on a download button. Here's my code: <p:selectOneRadio id="sorType" value="#{bean.type}" layout="custom"> <f:selectItem itemLabel="XML" itemValue="XML" /> <f

Get p:selectOneRadio value to a JS function

谁说我不能喝 提交于 2019-12-25 14:22:27
问题 I have a PF's selectOneRadio to choose a file type to download. Also I have a commandButton to call a download servlet using onclick attribute. The problem is that when I choose file type and click the button, the chosen value is of course not yet submitted. I'm looking for some way to get the chosen value available when I click on a download button. Here's my code: <p:selectOneRadio id="sorType" value="#{bean.type}" layout="custom"> <f:selectItem itemLabel="XML" itemValue="XML" /> <f

Erratic LINQ to SQL Error: “operation cannot be performed during a call to SubmitChanges.”

纵饮孤独 提交于 2019-12-25 04:42:36
问题 Okay, so I'm getting this error from the lines: System.Data.Linq.DataContext.CheckNotInSubmitChanges() +42 System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) +54 What I'm doing is tracking an application's state and logging each request. The app renders output in Json, Xml and Html. The thing is the error is erratic. It only happens every few requests. The error started happening when I started doing Ajax requests. I've been able to determine that the error occurs more

LINQ to SQL SubmitChangess() progress

梦想的初衷 提交于 2019-12-19 21:45:20
问题 I'm using LINQ to SQLto import old DBF files into MSSQL. I'm reading all rows and adding them to database using ctx.MyTable.InsertOnSubmit(row) After reading phase is completed I have around 100 000 pending inserts. ctx.SubmitChanges() naturally is taking a long time. Is there any way to track progress of the ctx.submitchanges() ? Can ctx.Log somehow be used for this purpose? Update : Is it possible to use ctx.GetChangeSet().Inserts.Count and track insert statements using the Log? Dividing

LINQ to SQL SubmitChangess() progress

孤人 提交于 2019-12-19 21:45:11
问题 I'm using LINQ to SQLto import old DBF files into MSSQL. I'm reading all rows and adding them to database using ctx.MyTable.InsertOnSubmit(row) After reading phase is completed I have around 100 000 pending inserts. ctx.SubmitChanges() naturally is taking a long time. Is there any way to track progress of the ctx.submitchanges() ? Can ctx.Log somehow be used for this purpose? Update : Is it possible to use ctx.GetChangeSet().Inserts.Count and track insert statements using the Log? Dividing

Exceptions by DataContext

拥有回忆 提交于 2019-12-18 12:22:34
问题 I've been doing some searching on the internet, but I can't seem to find the awnser. What exceptions can a DataContext throw? Or to be more specific, what exceptions does the DataContext.SubmitChanges() method throw? EDIT For reference, here a List of possible known exceptions that could be thrown by the L2S DataContext: SqlException ChangeConflictException DuplicateKeyException ForeignKeyReferenceAlreadyHasValueException OutOfMemoryException (when not correctly disposing the DataContext) 回答1

Silverlight DomainContext load with two separate DomainDataSources

烈酒焚心 提交于 2019-12-11 16:49:03
问题 I have a confusion regarding DataContext which i would like someone to confirm or comment please. In plain English, I believe a DataContext is a container which can be filled with entities upon load. e.g. I have two entities named Customers and Orders . I now declare a new DomainContext var ctx = new MyWebServices.MyDomainContext(); I load Customers in a DomainDataSource like this: DomainDataSource ddsCustomer = new DomainDataSource(); ddsCustomer.context = ctx; ddsCustomer.query = ctx

How often to call DataContext.SubmitChanges() for a large number of inserts?

感情迁移 提交于 2019-12-11 14:47:30
问题 How many InsertOnSubmit should I call before calling SubmitChanges ? I'm adding data from a web service that can return tens of thousands of records one record at a time. The wrapper class around the web service exposes the records a an IEnumberable collection to hide an elaborate chunking mechanism. Are there guidelines on how many inserts I should accumulate before submitting them? 回答1: It also depends on the kind of data you need to insert. Sometimes I need to insert a lot of records,