Mindscape.LightSpeed ​​Проблема с подключением к базе данных - PullRequest
1 голос
/ 03 декабря 2010

Я впервые использую Mindspace.Lightspeed в настольном приложении C #, но получаю ошибки и не могу подключиться к базе данных.alt text

My App.config содержит следующий код:

<?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>

1 Ответ

2 голосов
/ 03 декабря 2010

Мне удалось воспроизвести вашу проблему, вам нужно изменить файл конфигурации так, чтобы имя раздела было

lightSpeedContexts , а не lightSpeedContext

см. Мой файл конфигурации

<?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>
...