Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > FAQ > General FAQ> "The key 'Main.ConnectionString' does not exist"
 

Pages: 1
General FAQ
"The key 'Main.ConnectionString' does not exist"
Page:1/1 

  Print all messages in this thread  
Poster Message
Aglaia
LLBLGen Pro Team



Location:
Scheveningen, The Netherlands
Joined on:
07-Sep-2003 21:16:00
Posted:
533 posts
# Posted on: 21-Aug-2007 14:18:46.  
Question:
I've downloaded the demo application and generated code using the SqlServer demo database 'Northwind'. I wrote a simple ASP.NET application using the code but when I try to run that application, it throws an exception with the following error: "The key 'Main.ConnectionString' does not exist in the appSettings configuration section." What caused this error?

Solution:
The generated code is a class library and is used in another program. The executable which ultimately is using the generated code (asp.net application, winforms application or console application), can be equiped with a .config file (web.config or app.config). LLBLGen Pro automatically generates a file called App.Config. This file contains a tag called . When you are using ASP.NET, you should copy that tag including its contents to the web.config file of your ASP.NET application and place it directly inside the tags. Now, the ASP.NET application has a definition of the Main.ConnectionString key and value and the generated code can read that key now to connect to the database. When you use winforms or a console application you can use the complete app.config file generated by LLBLGen Pro by adding it to the .exe project.
Aglaia Kuipers, The LLBLGen Pro Team

Join the LLBLGen Pro support team!
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.