Using vistaDB4 with version DA 2014.1.225.2

7 posts, 0 answers
  1. Rob
    Rob avatar
    6 posts
    Member since:
    Jan 2011

    Posted 08 Apr 2014 Link to this post

    HI,
    Just installed the latest (full) version of Data Access (2014.1.225.2).  The version release notes (www.telerik.com/support/whats-new/data-access/release-history/q1-2014) read:
    Support for VistaDB 5.0 - Telerik Data Access supports VistaDB 5.0 now. If the VistaDB driver is not registered in the provider factories, Telerik Data Access will fallback to the 5.0 versions of VistaDB. If the application is running in a 4.0 .NET VM, the VistaDB.5.NET40.dll is used if not the VistaDB.5.NET20.dll.

    I need to use vistaDB4 until 5 testing is complete however my .net 4.0 website works fine with VistaDB4 (and DA 2014.1.225.2) locally BUT not when it is deployed. It then defaults to VistaDB5 and returns an error message:
    System.Configuration.ConfigurationErrorsException: Database provider VistaDB.Provider.VistaDBProviderFactory, VistaDB.5.NET40, Version=5.0.0.0, Culture=neutral, PublicKeyToken=dfc935afe2125461 not installed properly (CLR=v4.0.30319 64bit). ---> System.IO.FileNotFoundException: Could not load file or assembly 'VistaDB.5.NET40, Version=5.0.0.0, Culture=neutral, PublicKeyToken=dfc935afe2125461' or one of its dependencies. The system cannot find the file specified. at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) at System.Type.GetType(String typeName, Boolean throwOnError) at OpenAccessRuntime.ProviderFactoryLoader.LoadImpl(String name, LogEventStore log, Int32 id) --- End of inner exception stack trace --- at OpenAccessRuntime.ProviderFactoryLoader.LoadImpl(String name, LogEventStore log, Int32 id) at OpenAccessRuntime.Relational.RelationalStorageManagerFactory..ctor(StorageManagerFactoryBuilder b) at OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL()

    If I include VistaDB.5.NET40 in the bin folder I get errors saying the the database needs updating to version 5. 

    Can someone please show me what to get the latest version of DA working with vistaDB4? How do I register it in the provider factories, as suggested above???
    Many thanks
    Rob 
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 09 Apr 2014 Link to this post

    Hi Rob,

    There is a nice article about the same issue with SqLite. Please have a look here:

    3 ways to use the SQLite NuGet with Telerik Data Access

    Regards,
    Jan Blessenohl
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
  3. DevCraft banner
  4. Rob
    Rob avatar
    6 posts
    Member since:
    Jan 2011

    Posted 09 Apr 2014 in reply to Jan Blessenohl Link to this post

    Many thanks Jan. For others, this is the code that worked:

     <connectionStrings>
        <add name="PoiConnection" connectionString="data source=|DataDirectory|\site.vdb4; Open Mode = NonexclusiveReadWrite" providerName="System.Data.VistaDB" />
    </connectionStrings> 

    <system.data>
        <DbProviderFactories>
          <remove invariant="System.Data.VistaDB5" />
          <add invariant="System.Data.VistaDB" name="VistaDB 4 Data Provider"
               description="VistaDB 4 ADO.NET Provider for .Net"
                type="VistaDB.Provider.VistaDBProviderFactory, VistaDB.4" />
        </DbProviderFactories>
      </system.data> 

    Thanks again for your help.
    Cheers
    Rob
  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 09 Apr 2014 Link to this post

    Hello Rob,
    This is indeed missing functionality, we will fix it for the next release (sorry, not todays).

    You can specfiy the connection string after choosing 'Set Manual Manually' in the second screen of the wizard.

    Hope that helps,
    Jan Blessenohl
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
  6. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 09 Apr 2014 Link to this post

    Hello,
    Sorry, right answer to wrong post, pls. ignore my last answer.

    Regards,
    Jan Blessenohl
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
  7. Rob
    Rob avatar
    6 posts
    Member since:
    Jan 2011

    Posted 09 Apr 2014 in reply to Jan Blessenohl Link to this post

    Thanks Jan, I very much appreciate your efforts.

    FYI, This was sent to me by Gilbraltar (may be of some help to others):

    When they talk about a provider factory they're talking about registering the ADO.NET provider factory.  What you want to do is make one of these entries:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <system.data>
        <DbProviderFactories>
          <remove invariant="System.Data.VistaDB5" />
          <add invariant="System.Data.VistaDB5" name="VistaDB 5 Data Provider"
               description="VistaDB 5 ADO.NET Provider for .Net"
                type="VistaDB.Provider.VistaDBProviderFactory, VistaDB.5.NET40" />
        </DbProviderFactories>
      </system.data>
    </configuration>

    Now in your case you'll want to specify VistaDB 4. So the key there is to change it at least like this:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <connectionStrings>
        <add name="YourAppConnection"
             connectionString="Data Source='|DataDirectory|\Database.vdb5'"
             providerName="System.Data.VistaDB5" />
      </connectionStrings>
      <system.data>
        <DbProviderFactories>
          <remove invariant="System.Data.VistaDB5" />
          <add invariant="System.Data.VistaDB5" name="VistaDB 5 Data Provider"
               description="VistaDB 5 ADO.NET Provider for .Net"
                type="VistaDB.Provider.VistaDBProviderFactory, VistaDB.4" />
        </DbProviderFactories>
      </system.data>
    </configuration>

    Or more correctly (as it was in VistaDB 4)
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <connectionStrings>
        <add name="YourAppConnection"
             connectionString="Data Source='|DataDirectory|\Database.vdb5'"
             providerName="System.Data.VistaDB5" />
      </connectionStrings>
      <system.data>
        <DbProviderFactories>
          <remove invariant="System.Data.VistaDB" />
          <add invariant="System.Data.VistaDB" name="VistaDB 5 Data Provider"
               description="VistaDB ADO.NET Provider for .Net"
                type="VistaDB.Provider.VistaDBProviderFactory, VistaDB.4" />
        </DbProviderFactories>
      </system.data>
    </configuration>

    Cheers
    Rob

  8. Dennis
    Dennis avatar
    15 posts
    Member since:
    Feb 2009

    Posted 27 Jul 2014 in reply to Rob Link to this post

    Rob --

    Thanks for posting the solution to this.  I just ran into the same issue when deploying a web application for testing and your solution worked perfectly!!!

    Thanks again,
    Dennis
Back to Top
DevCraft banner