﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Error Running Form</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 13 Sep 2026 16:56:24 GMT</lastBuildDate><ttl>20</ttl><item><title>Error Running Form</title><link>http://forum.strataframe.net/FindPost13662.aspx</link><description>I get the following error when I run my project and since I am a newbie I am not sure where to start on this one.&lt;br&gt;
TIA  Terry Bottorff &lt;br&gt;
[code]&lt;br&gt;
System.InvalidOperationException was unhandled&lt;br&gt;
  Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: An error occurred while creating a new DataLayer for the business object."&lt;br&gt;
  Source="Lighting"&lt;br&gt;
  StackTrace:&lt;br&gt;
       at Lighting.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190&lt;br&gt;
       at Lighting.My.MyProject.MyForms.get_Customers()&lt;br&gt;
       at Lighting.Customers.Main() in C:\Documents and Settings\Terry\My Documents\Visual Studio 2005\Projects\Lighting\Lighting\Customers.Designer.vb:line 2&lt;br&gt;
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)&lt;br&gt;
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)&lt;br&gt;
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()&lt;br&gt;
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)&lt;br&gt;
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)&lt;br&gt;
       at System.Threading.ThreadHelper.ThreadStart()&lt;br&gt;
[/code]&lt;br&gt;</description><pubDate>Sun, 27 Jan 2008 10:26:32 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Error Running Form</title><link>http://forum.strataframe.net/FindPost13749.aspx</link><description>[quote]Does it matter if I created a BO project in the solution because on the second try I just added a BO and not a BO project and then a BO to that project? [/quote]&lt;/P&gt;&lt;P&gt;No.&amp;nbsp; This will not make a difference.&amp;nbsp; If I had to guess, I would assume that the first time you did not create an SF application but just a standard .NET application which does not have the AppMain, references, etc. that the SF app expects.&amp;nbsp; In any case, when designing an application, it is always best to store BOs in a class library anyway instead of the entry point executable.&amp;nbsp; This will give you more flexibility when creating other assemblies or scaling your application.</description><pubDate>Sun, 27 Jan 2008 10:26:32 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Error Running Form</title><link>http://forum.strataframe.net/FindPost13732.aspx</link><description>I don't remember doing that and I don't remember reading how you do that? TIA.</description><pubDate>Fri, 25 Jan 2008 09:32:09 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Error Running Form</title><link>http://forum.strataframe.net/FindPost13725.aspx</link><description>Hi Terry.&lt;/P&gt;&lt;P&gt;On your first try, did you have a reference to you Business Library added to your main project?</description><pubDate>Fri, 25 Jan 2008 07:40:43 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Error Running Form</title><link>http://forum.strataframe.net/FindPost13713.aspx</link><description>I recreated the whole project again and it worked. The only thing I did different at least I think the only thing is I tried on the first one to add a BOLib project to the solution and used a BO out of it for the data and on the second one I just added the BO to the project. It should have worked the same shouldn't it? TIA.</description><pubDate>Thu, 24 Jan 2008 10:20:31 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Error Running Form</title><link>http://forum.strataframe.net/FindPost13712.aspx</link><description>Thank you. I recreated the whole project and apparently I did something wrong the first time because the second time it worked. Does it matter if I created a BO project in the solution because on the second try I just added a BO and not a BO project and then a BO to that project? I don't think it should... Thanks</description><pubDate>Thu, 24 Jan 2008 10:17:54 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Error Running Form</title><link>http://forum.strataframe.net/FindPost13670.aspx</link><description>I looks as though you have not setup your connection string in the DataSources collection.&amp;nbsp; It is trying to create a DataLayer which uses the DataSOurces collection.&amp;nbsp; You can use the Connection String Wizard or manually add a connection to the data sources.&amp;nbsp; This will be done in the AppMain.vb or program.cs file depending on which language you are using.&amp;nbsp; You will want to provide this in the SetDataSources method.&amp;nbsp; There is quite a bit of documentation regarding setting up a connection string (as well as a number of other posts here on the forum).&amp;nbsp; But the very first thing to look at would be your connection string in the SetDataSources method of the AppMain.vb file.</description><pubDate>Wed, 23 Jan 2008 09:19:03 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>