2010-12-03 12 views
1

私のC#デスクトップアプリケーションで初めてMindspace.Lightspeedを使用していますが、エラーが発生してデータベースに接続できません。 alt textMindscape.LightSpeedデータベース接続の問題

私の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> 

答えて

2

をセクション名が

lightSpeedContextsあるように、あなたの設定ファイルを変更する必要が not 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>