Questions tagged [updateexception]

12 questions
7
votes
0 answers

How to determine the correct constraint violation on SQLite UpdateException?

I have the following problem qith my local SQLite database. I'm trying to update the data stored via a synchronisation-process with an online SQL-Server database. While there is no problem with the synchonization I often encounter errors when trying…
KingKerosin
  • 3,639
  • 4
  • 38
  • 77
4
votes
3 answers

How handle UpdateException?

I need handle exception duplicate. var resource = new Resource() { url = tbUrl.Text }; try { context.Resource.AddObject(resource); context.SaveChanges(); } catch(UpdateException ex) { // how to know exactly which is why the error…
Mediator
  • 14,951
  • 35
  • 113
  • 191
4
votes
4 answers

An exception of type 'Microsoft.EntityFrameworkCore.DbUpdateException' occurred in Microsoft.EntityFrameworkCore.dll

I am having trouble at very long time. Lets imagine this example: public class Coordinate { public int id {get;set;} public int x {get;set;} public int y {get;set;} } public class Planet { public int id {get;set;} public…
1
vote
1 answer

TryUpdateModel / UpdateModel does not work?

I'm trying to update multiple objects that exist in database and save new objects, but it doesnt work? Here is my code: [HttpPost] public ActionResult Edit(MasterModel Model) { DBEntities db = new DBEntities(); var…
jperez
  • 1,020
  • 1
  • 10
  • 25
1
vote
1 answer

Using DB-Default values for unmapped bit columns in entity framework 4 (database first)

I am trying to map two concrete entity types and an abstract base type to the same database table. The table contains a bit column that does not accept null. Column has a default value: ((0)). Only one of the two concrete entity types (i.e. concrete…
1
vote
1 answer

.NET / Entity Framework - System.Data.UpdateException not precise enough?

i got thrown into a small .NET migration project that is using the Entity Framework and MS SQL Server 2005. when persisting data that is not working with db schema (e.g. a string is too long), I am getting an exception System.Data.UpdateException…
fischermatte
  • 3,327
  • 4
  • 42
  • 52
1
vote
1 answer

Entity Framework UpdateException relationships in Added and Deleted states

I have a table of Plants and Information. Plants have an ID, Name, ..., MainInformationID Information have an ID, Title, ..., PlantID One plant can have many information, but only one MainInformation. Information can only have one plant. I have a…
synepis
  • 1,292
  • 16
  • 28
0
votes
0 answers

Unhandled Exception: FileSystemException: Cannot open file, path = '/assets/mood.xlsx' (OS Error: No such file or directory, errno = 2)

While trying to save the changes I made in an excel file with flutter, this error raised, and the changes are not being saved. Here is the code _updateExcel() async{ ByteData data = await rootBundle.load('assets/mood.xlsx'); var bytes =…
0
votes
0 answers

Solr: Using IgnoreFieldUpdateProcessorFactory

I want to prevent the /update/extract request from adding new fields to the schema.xml like "media_white_point"... I tried to add the update processor IgnoreFieldUpdateProcessorFactory to the "UpdateRequestProcessorChain" which includes…
0
votes
2 answers

Entity Framework / EF4: Multiple inserts of related entities in a transactionscope

I have a similar problem. I want to make two inserts in the same transactionscope. The objects are related and have a FK relationship between them, but for several reasons I do not want to connect them via the navigation property, but only by…
0
votes
1 answer

Syntax error in UPDATE statement OleDbException

I'm writing an application which stores user information. Currently the user is supposed to update their Name, Height, Weight and Birthday. string height = TB_ClientHeight.Text; string weight = TB_ClientWeight.Text; string name =…
kkmonlee
  • 379
  • 2
  • 16
0
votes
1 answer

Please help me update records of access filenames "Data.accdb"in Vb.net using oledb connection

Getting Error While Updating Record. Firs of all i select a row from Datagrid then selected row's values displayed to textbox then i click update button to update record. After entered New usename and password click save Buton then getting error as…
Nakul14
  • 13
  • 3