Search code examples
c#connection-stringlightspeed

Mindscape.LightSpeed Database connectivity problem


I'm using Mindspace.Lightspeed in my C# desktop application for the first time but I'm getting errors and unable to connect to database. alt text

My App.config contains the following code:

<?xml version="1.0" encoding="utf-8" ?><configuration>
<configSections>
<section name="lightSpeedContext" type="Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection,Mindscape.LightSpeed" /></configSections><connectionStrings>
<add name="DefectsConStr" connectionString="Data Source=.\sqlexpress2k5;Initial Catalog=Defects;Persist Security Info=True;User ID=sa;Password=123"
  providerName="System.Data.SqlClient" /></connectionStrings>  <lightSpeedContext>
 <add name="Development" connectionStringName="DefectsConStr" dataProvider="SqlServer2005"/> </lightSpeedContext> </configuration>

Solution

  • I have managed to reproduce your problem, you need to change your configuration file so that the section name is

    lightSpeedContexts and not lightSpeedContext

    see my configuration file

    <?xml version="1.0"?>
    <configuration>
      <configSections>
        <section name="lightSpeedContexts" type="Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection,Mindscape.LightSpeed"/>
      </configSections>
      <connectionStrings>
        <add name="Blog" connectionString="Data Source=Blog.dat"/>
      </connectionStrings>
      <lightSpeedContexts>
        <add name="Blog" connectionStringName="Blog" dataProvider="SQLite3" identityMethod="KeyTable" pluralizeTableNames="false"/>
      </lightSpeedContexts>
    </configuration>