This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello,
I get an exception when doing uow.SaveChanges() see this image: Thats my appconfig file:
<?xml version="1.0" encoding="utf-8" ?> <configuration>
<configSections> <section name="lightSpeedContexts" type="Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection, Mindscape.LightSpeed" /> </configSections>
<lightSpeedContexts> <add name="Development" dataProvider="Sqlite3" connectionStringName="Development" pluralizeTableNames="False" /> </lightSpeedContexts>
<connectionStrings> <add name="Development" connectionString="data source=TBMdb.db"/> </connectionStrings>
<startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup>
</configuration>
thats my test code:
class Program { static void Main() { using (var uow = DataAccess.Context.CreateUnitOfWork()) { uow.Add(new SchoolclassCode() { SchoolclassCodeName = "12bBio" }); uow.SaveChanges(); } } }
What do I wrong that LightSpeed can not find the table? |
|
|
Probably a working directory issue. I'd guess that the TBMdb.db file shown in Server Explorer is not in the application working directory. When SQLite failed to find the TBMdb.db file in the working directory, it quietly created a new one, but of course that doesn't contain your table definitions. Either copy the TBMdb.db file to the app directory as a post-build event, or use a path in the connection string to specify the location of the file. |
|
|
ah yes... actually the db was put in the same dir as the appconfig so I thought I am fine. For a quick test I made a hardcoded absolute string and it worked. Thanks Ivan. |
|