Delphy XE7 - EntityTable append record when field is AutoInc, missing refresh field value

Discussion of open issues, suggestions and bugs regarding EntityDAC
Post Reply
abnerh69
Posts: 7
Joined: Tue 06 Jan 2015 15:58

Delphy XE7 - EntityTable append record when field is AutoInc, missing refresh field value

Post by abnerh69 » Thu 15 Jan 2015 16:03

Hi,

In a simple MSSQL table designed and generated using Entity Developer v5.7.451 with two fields :

CREATE TABLE dbo.Inventory (
InventoryId INT NOT NULL IDENTITY,
InventoryDescription NVARCHAR(120),
CONSTRAINT PK_Inventory PRIMARY KEY (InventoryId)
)

I insert some records and work ok in Management Studio.

Then, in Delphi XE7, using the following EntityConnection, EntityTable, and EntityDataSource components:

object mainConnection: TEntityConnection
LoginPrompt = False
ConnectionString =
'Data Provider=SDAC;SQL Dialect=SQL Server;Login Prompt=False;Ser' +
'ver=DEVELOP\SQLEXPRESS;Database=DataInventory;Integrated Se' +
'curity=True'
ProviderName = 'SDAC'
DialectName = 'SQL Server'
DefaultModelName = 'DataInventoryModel'
end

(of course, I'd included EntityXMLModel, SDACDataProvider and EntityContext and configured them)

object dsInventory: TEntityDataSource
AutoEdit = False
DataSet = entityInventory
Left = 144
Top = 272
end
object entityInventory: TEntityTable
FieldExpressions = <>
Context = EntityContext1
TypeName = 'Inventory'
object entityInventoryInventoryId: TIntegerField
AutoGenerateValue = arAutoInc
FieldName = 'InventoryId'
end
object entityInventoryDescription: TStringField
FieldName = 'InventoryDescription'
Size = 120
end
end

Then I bind those fields to a simple TListView (with Text to InventoryDescription, and Detail to InventoryId)
And a TEdit binded to InventoryDescription and a TBindNavigator binded to the TDataSource
Looks great! It shows all records previously added on Management Studio with both fields very well.

The problem is when I insert a new record, it goes to the Database and data is saved correctly.

But, it seem do not refresh the InventoryId field with new value. Then it shows 0 in Detail.

When I try to create a new one, there is an error:
Inserting error: "List does not allow duplicates ($0%x)"

And when I update same new field, then, new changes don't go to Database.

I think: Of course!, inside entityTable there is no InventoryId updated with new value.

Can you help me? What am I missing?

Thanks

Abner

abnerh69
Posts: 7
Joined: Tue 06 Jan 2015 15:58

Re: Delphy XE7 - EntityTable append record when field is AutoInc, missing refresh field value

Post by abnerh69 » Mon 19 Jan 2015 05:52

Hi

here is a project test to show the error(s)

Please let me know what am I doing wrong.

Thanks.

https://drive.google.com/file/d/0Bx_vp7 ... sp=sharing

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Delphy XE7 - EntityTable append record when field is AutoInc, missing refresh field value

Post by AlexP » Tue 20 Jan 2015 10:46

Hello,

Thank you for the information, we have already fixed this problem, the fix will be included to the next version.

abnerh69
Posts: 7
Joined: Tue 06 Jan 2015 15:58

Re: Delphy XE7 - EntityTable append record when field is AutoInc, missing refresh field value

Post by abnerh69 » Tue 20 Jan 2015 11:47

Thank you AlexP

I really appreciate your time to check it out.

Please, can you tell me how much time it will takes? I mean, when you deploy a new version?

Thank you again.

Abner

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Delphy XE7 - EntityTable append record when field is AutoInc, missing refresh field value

Post by AlexP » Tue 20 Jan 2015 13:29

We plan to release the build including this fix next week.

abnerh69
Posts: 7
Joined: Tue 06 Jan 2015 15:58

Re: Delphy XE7 - EntityTable append record when field is AutoInc, missing refresh field value

Post by abnerh69 » Mon 02 Feb 2015 11:12

Hi AlexP,

still waiting...

Abner

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Delphy XE7 - EntityTable append record when field is AutoInc, missing refresh field value

Post by AlexP » Tue 03 Feb 2015 08:04

We have already fixed this issue. The new version with this fix is already available for download at our website.

Post Reply