The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Cannot Save using 2008.0.0518.0

Last post 06-06-2008, 7:29 PM by Granticus. 3 replies.
Sort Posts: Previous Next
  •  06-06-2008, 2:20 PM 9669

    Cannot Save using 2008.0.0518.0

    I am receiving the following error

         Cannot insert the value NULL into column 'Address1', table 'My3DRooms.dbo.Location'; column does not allow nulls. INSERT fails.

    SQL Profiler shows the following:

     

    Code:
    exec sp_executesql N'SET NOCOUNT OFF INSERT INTO [Location]([LocationId], [Address1], 
    [City], [Region], [PostalCode], [Country])
    VALUES (@LocationId, @Address1, @City, @Region, @PostalCode, @Country)'
    ,
    N'@LocationId uniqueidentifier,@Address1 varchar(8000),@City varchar(8000),
    @Region varchar(8000),@PostalCode varchar(8000),@Country varchar(8000)'
    ,
    @LocationId = 'AB7FF6CD-2F26-4F1E-AB23-9AB3015ADDB8',
    @Address1 = NULL,
    @City = NULL,
    @Region = NULL,
    @PostalCode = NULL,
    @Country = NULL
     

    But the weird part is that when I check the properties of my Location variable in the VS IDE, it shows that Address1 is NOT null, but in fact the "123 Main St." that I entered as a test value. Any idea what might be wrong?


    ES 2008.1.1110.0
    VS 2008 Pro SP1 on Vista Ultimate x64
    SQL Server 2000
  •  06-06-2008, 5:35 PM 9675 in reply to 9669

    Re: Cannot Save using 2008.0.0518.0

    Wow, that's pretty thoroughly tested on our end, and would affect so many users, it's hard to believe something like that could slip by. What code generator and SQL Server versions are you using? Can you post the CREATE TABLE? Are all changed fields coming through NULL, or just that one, in that one table?
    David Neal Parsons
    www.entityspaces.net
  •  06-06-2008, 5:44 PM 9676 in reply to 9675

    Re: Cannot Save using 2008.0.0518.0

    Another thought... If the changes are occurring in bound controls, are you calling EndEdit() on the entity or BindingSource before calling Save()?
    David Neal Parsons
    www.entityspaces.net
  •  06-06-2008, 7:29 PM 9679 in reply to 9676

    Re: Cannot Save using 2008.0.0518.0

    David, you are THE MAN!  It's been months since I've been down and dirty with ES in my last project and apparently in the meantime I had forgotten such simple things as calling EndEdit on my bound entity.  Once I added that, saving worked!

     

    Thanks!  You saved my weekend! Big Smile

     


    ES 2008.1.1110.0
    VS 2008 Pro SP1 on Vista Ultimate x64
    SQL Server 2000
View as RSS news feed in XML