Error Running Form


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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?

No.  This will not make a difference.  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.  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.  This will give you more flexibility when creating other assemblies or scaling your application.

Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
I don't remember doing that and I don't remember reading how you do that? TIA.
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Terry.

On your first try, did you have a reference to you Business Library added to your main project?

Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
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.
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
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
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I looks as though you have not setup your connection string in the DataSources collection.  It is trying to create a DataLayer which uses the DataSOurces collection.  You can use the Connection String Wizard or manually add a connection to the data sources.  This will be done in the AppMain.vb or program.cs file depending on which language you are using.  You will want to provide this in the SetDataSources method.  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).  But the very first thing to look at would be your connection string in the SetDataSources method of the AppMain.vb file.
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
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.

TIA Terry Bottorff



System.InvalidOperationException was unhandled

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

Source="Lighting"

StackTrace:

at Lighting.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190

at Lighting.My.MyProject.MyForms.get_Customers()

at Lighting.Customers.Main() in C:\Documents and Settings\Terry\My Documents\Visual Studio 2005\Projects\Lighting\Lighting\Customers.Designer.vb:line 2

at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)

at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search