\'System.IO.FileNotFoundException\' in Eco.Persistence.SqlServer.dll

CapableObjects Forums SupportForum \'System.IO.FileNotFoundException\' in Eco.Persistence.SqlServer.dll

This topic contains 3 replies, has 2 voices, and was last updated by  Admin 5 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5140 Score: 0

    SteveA
    Participant

    Greetings

    I encountered a FileNotFoundException exception
    Could not load System.Data.SqlServerCe
    This occurred when trying to save a BtyeArray

    The problem goes away if System.Data.SqlServerCe is added to the project.
    System.Data.SqlServerCe is not part of any Mdriven nuget package.
    There is no warning at compile time just an exception at runtime.

    Regards Steve

    • This topic was modified 5 years, 10 months ago by  SteveA.
    • This topic was modified 5 years, 10 months ago by  SteveA.
    Attachments:
    You must be logged in to view attached files.
    #5162 Score: 0

    Admin
    Keymaster

    This is a side effect of the SQLServer mapper doubling down as as SQLServerCompact as well.

    Compact database needed special treatment of parameters

    
      public class SqlCeHelper
      {
        public static void SetSqlDbTypeOnParam(IDataParameter parameter, SqlDbType dbtype)
        {
          if (parameter is SqlParameter)
            ((SqlParameter)parameter).SqlDbType = dbtype;
          else if (parameter is System.Data.SqlServerCe.SqlCeParameter)
            ((System.Data.SqlServerCe.SqlCeParameter)parameter).SqlDbType = dbtype;
    
        }
      }

    for all these types in the enclosed image

    Attachments:
    You must be logged in to view attached files.
    #5166 Score: 0

    SteveA
    Participant

    Sorry, but I don’t understand. I’m not using SQLServerCompact, but for some reason it appears to be required when trying to save a ByteArray SqlServer Standard Edition.
    regards Steve

    #5170 Score: 0

    Admin
    Keymaster

    For now you will need to reference and include the the System.Data.SqlServerCe assembly in your SqlServer using app.

    But I will check in an update to remove this need today.
    I found that JIT-compile of method SetSqlDbTypeOnParam failed when it referenced the ce-param type and the ce assembly was not loaded. Just moving the check to a separate method only called if the normal non-ce param check fails solved the issue.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Comments are closed.