The value cannot be NULL.\r\nParametername: input

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
drichter
Posts: 20
Joined: Fri 21 Aug 2009 14:44

The value cannot be NULL.\r\nParametername: input

Post by drichter » Fri 25 Sep 2009 08:51

I get an error like this:

The value cannot be NULL.\r\nParametername: input

on a create or an update on a single table via SubmitChanges() ( other tables are working )...


Any ideas?




Stacktrace:

Code: Select all

   bei Devart.Data.Linq.v.b(MetaType A_0, q A_1, Boolean A_2)
   bei Devart.Data.Linq.a.a(c A_0, Object A_1, ModifiedMemberInfo[] A_2, Boolean A_3)
   bei Devart.Data.Linq.k.a(a A_0, c A_1, Boolean A_2)
   bei Devart.Data.Linq.k.a(DataContext A_0, ConflictMode A_1)
   bei Devart.Data.Linq.k.b(DataContext A_0, ConflictMode A_1)
   bei Devart.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
   bei Common.DB.BaseModel.Save() in DD:\XXXX\DB\BaseModel.cs:Zeile 34.
   bei Common.DB.StoreModel.CreateStore(Store s) in D:\XXXX\StoreModel.cs:Zeile 40.
   bei WebApp.Controllers.AccountController.Register(String firstName, String lastName, String email, String emailConfirm, String password, String confirmPassword, String usertype, String accesscode, String captcha) in D:\XXXX\AccountController.cs:Zeile 206.

drichter
Posts: 20
Joined: Fri 21 Aug 2009 14:44

Post by drichter » Fri 25 Sep 2009 09:21

Ok, now i recreated the entity of that table in the entity developer and now there is now error anymore, but NO UPDATE to the table ( which is even worse )...

When iam investigating at the DataContext, i can see the changed values of the row i changed..

When i call "SubmitChanges()" now, there is no error or something but also no update to the database...

When iam looking at the Logoutput of the DataContext.Log there are only "select-statements" in it, but no UPDATE statement...

So?

Edit: Updates on other tables are still working... Updates via SQL-Editor are also working, so no SQL error or something

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 25 Sep 2009 12:23

Could you please send me (support * devart * com, subject "LINQ: Value cannot be null")
a small test project reproducing the problem?
Please include the script of DB objects into the project.

drichter
Posts: 20
Joined: Fri 21 Aug 2009 14:44

Post by drichter » Sun 27 Sep 2009 14:06

i found out why the update is not working...

When iam using the partial of the method "UpdateXXX" like this, it's not updating anything:

Code: Select all

    public partial class DataContext
    {
        partial void UpdateStore(Store instance)
        {
            instance.Seo_unique_keystring = Tools.GetUniqueStoreSeoString(instance, "");
        }
    }
this way it's working:

Code: Select all

    public partial class DataContext
    {
        /*partial void UpdateStore(Store instance)
        {
            instance.Seo_unique_keystring = Tools.GetUniqueStoreSeoString(instance, "");
        }*/
    }
Why is this? I really go crazy with this "undocumented" behaviour of this LINQ stuff...

btw. if iam adding a "this.SubmitChanges();" below the update of the instance i get a "StackOverflowException" in "mscorlib.dll"..

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 28 Sep 2009 13:05

Probably you forgot to call the base.ExecuteDynamicUpdate(instance) method.
If you call SubmitChanges in the UpdateStore method, you should expect the StackOverflowException,
because SubmitChanges() calls the UpdateStore method.

drichter
Posts: 20
Joined: Fri 21 Aug 2009 14:44

Post by drichter » Thu 01 Oct 2009 13:10

Thanks!

Post Reply