Go to SoftFluent site to register or reset your account
Welcome Guest Search | Active Topics | Log In

SqlException while loading data Options
Sébastien
#1 Posted : Monday, July 19, 2010 2:54:38 PM
Rank: Newbie

Groups: Users

Joined: 7/6/2010
Posts: 6
Hello,

I have a simple solution with 4 projects (Design / BOM / Persistence / WPF)
I successfully generated the BOM & Persistence using the VS integrated modeler.

When, on the UI, I want to get data from the BOM (XxxCollection.LoadAll()), the application stop responding for several seconds and I have a VS error message :

Quote:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll

Additional information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


It looks like my SQL Server instance isn't found, but I specified it in the designer (so it is in the BOM). Do I need to precise the ConnectionString in the UI (WPF project) ? If yes, where ?

Regards,

Sébastien
Carl
#2 Posted : Tuesday, July 20, 2010 3:05:27 PM
Rank: Advanced Member

Groups: Users

Joined: 8/13/2009
Posts: 96
Hi,

You need to specify a connection string in your application configuration, so your application knows where to connect to.
Detailed information on how to do this is available in the documentation:
CodeFluent Entities > Developer Guide > The Business Object Model > Application Configuration.

The connection string you specified in the Modeler (at design time) is used by the persistence producer to run the generated scripts at production time.
Here, you're now one step further: at run time. Since the connection string isn't hard-coded in the output, you need to set it up in your configuration.

Cheers,
Carl
Sébastien
#3 Posted : Tuesday, July 20, 2010 5:12:44 PM
Rank: Newbie

Groups: Users

Joined: 7/6/2010
Posts: 6
Hello,

Thanks, with the appropriated connection string, it works great.

Sébastien
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.301 | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.067 seconds.