Northwind Tutorial Build error in Visual Studio

Posts   
 
    
cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 01-Mar-2008 23:26:09   

Hello, I have the Northwind.Tutorial Solution added in Visual Studio 2005, after generating the code following the tutorial (C# and Adapter).

When I build the solution in Visual Studio, I get the 6 errors posted below. I am using the latest Demo version of LLBLGen Pro, Visual Studio 2005 version 8.0.50727.42; .Net Framework version 2.0.50727

Thanks, Carol

Error 1 Unrecognized escape sequence C:\temp\NorthwindTutorial\DAL\DatabaseSpecific\RetrievalProcedures.cs 61 66 Northwind.TutorialDBSpecific Error 2 Unrecognized escape sequence C:\temp\NorthwindTutorial\DAL\DatabaseSpecific\RetrievalProcedures.cs 61 99 Northwind.TutorialDBSpecific Error 3 Unrecognized escape sequence C:\temp\NorthwindTutorial\DAL\DatabaseSpecific\RetrievalProcedures.cs 102 66 Northwind.TutorialDBSpecific Error 4 Unrecognized escape sequence C:\temp\NorthwindTutorial\DAL\DatabaseSpecific\RetrievalProcedures.cs 102 99 Northwind.TutorialDBSpecific Error 5 Unrecognized escape sequence C:\temp\NorthwindTutorial\DAL\DatabaseSpecific\RetrievalProcedures.cs 117 70 Northwind.TutorialDBSpecific Error 6 Unrecognized escape sequence C:\temp\NorthwindTutorial\DAL\DatabaseSpecific\RetrievalProcedures.cs 117 103 Northwind.TutorialDBSpecific

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 01-Mar-2008 23:30:44   

Can you double check the generation settings in the code generation dialog (in the designer, press F7) and see if there's any anomalies in there.

Otherwise check C:\temp\NorthwindTutorial\DAL\DatabaseSpecific\RetrievalProcedures.cs is properly added to the DatabaseSpecific project.

cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 01-Mar-2008 23:43:01   

Hi, I looked at the output for the generator in LLBLGen, and things seem normal (but I'm new at this and might not recognize a problem). There are a list of "successful" things happening.

RetrievalProcedures.cs is in the DatabaseSpecific folder under Northwind.TutorialDBSpecific, in Visual Studio.

In looking at the problem code in Visual Studio, when I opened RetrievalProcedures.cs, the problem seems to be with the delimiter for the path. That is, there is a squiggly line under the backwards slash in code such as below.

"[C:\SQL SERVER 2000 SAMPLE DATABASES\NORTHWND.MDF] ...

Thanks for your quick reply,

Carol

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 02-Mar-2008 12:54:03   

Connect to the local sqlserver express database using .\SQLEXPRESS instead of specifying the path. That indeed doesn't work as you get the path as the catalog name, that's not recommended.

Frans Bouma | Lead developer LLBLGen Pro
cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 03-Mar-2008 20:07:53   

Thanks so much. I now get a successful build. And the offending slashes in the path to the database are gone, with the catalog reference as below:

.. CallRetrievalStoredProcedure("[Northwind].[dbo].[Sales by Year]" ..

And a very basic questions. Does the data connection get established through the LLBLGen code generation? That is, do I need to set up the data connection separately in Visual Studio before using the generated code?

Thanks,

Carol

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 04-Mar-2008 10:50:47   

The connection is opened and closed by LLBLGen Pro when it needs to. Please see the examples and the manual for details. I.o.w.: you don't need to babysit connections, that's been taken care of for you. Of course, if you want to keep open a connection in Adapter, you can.

Frans Bouma | Lead developer LLBLGen Pro
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 04-Mar-2008 10:57:31   

If I understand your question correctly, you only need to copy the generated connection string to your application config file.

The following is copied from the manual's section "Using the generated code -> Compiling the code":

Furthermore, you have to copy the generated app.config file to the executable project which references (indirectly perhaps via another assembly) the generated code. If you are developing a web project, you have to copy the appSettings tag and its contents of generated app.config file to the web.config file of your application, inside the configuration tag. This will make sure the generated code will be able to read the connection string.

.NET 2.0 or higher: Starting with .NET 2.0, a .config file (app.config or web.config) can have a separate connection strings section in which you can store the connection string as well. This is supported by LLBLGen Pro. A connection string specified in the connection strings section in the config file is read first. If a connection string with the name specified in the generated code is found there, that connection string is used. If it's not found, the appSettings section is consulted.

cgray
User
Posts: 62
Joined: 25-Nov-2007
# Posted on: 04-Mar-2008 19:04:23   

Thanks all for the clarification, this is helpful. I'm having a hard time getting used to so much being done for me! But like the idea of a configuration file taking care of things.

Carol