Database Connections - Forum server not responding

Database Connections - Forum server not responding

Old forum URL: forums.lhotka.net/forums/t/7567.aspx


DanEssin posted on Thursday, September 03, 2009

Hi,
I've been trying to post a question to the forum but the server seems to
be not responding.

My configuration is a SqlServer 2000 running on a dedicated machine -
which mimics my target production configuration. I have all the VS2008
and SQL 2008 components installed on my workstation, but no server
components. I need/want the PTracker apps to connect to my server where
copies of the databases are attached and functional.

I had this all working well with CSLA 2, but the last time I tried to
configure 3.6.2, the newer VStudio and the newer sqlserver client
components, there were dozens of references in the the PTracker samples
that all referred to .\sqlexpres... Obviously none of these worked and
I never figured out what the correct procedure was to retarget the apps
at my actual server. Now I am trying again with 3.7.

I have added new connections to the Data Connections section of the
Server Explorer that point to my SQL2000 server. These appear in the
PTData project. I've created references to these connections in the
Database References section of PTData but I don't see how these
references interact with any of the other projects in the solution.

With that as the background, in 3.7 and VS2008 working on PTWin (and
other) projects:
- What is the relationship between the database references in the PTData
project and the connectionStrings in the App.config of PTWin?
- What is the proper/recommended procedure to adjust all the database
references so that the apps will run against my server?

I get the sense that there must be some simple, straight forward
technique for doing this, but I have no clue what it is. It doesn't seem
cossible that I would have to search for every instance of
connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename="C:\Visual Studio
Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\PTracker.mdf";Integrated
Security=True;User Instance=True"
with the editor and replace the data source property with the new
connection string.

That's what I tried the last time and, although I got a few of the
projects to partially function, nothing every really ran correctly or
error free. The earlier versions of the BO book had some discussion of
connection strings byt the 2008 version doesn't have much to say on the
subject.

Your guidance would be appreciated and thank you,
Dan Essin

RockfordLhotka replied on Thursday, September 03, 2009

Remember that ProjectTracker is showing nearly every possible permutation of configurations for CSLA apps...

The connection strings are only pulled out of exactly one config file when you are running the app - but that one config file is dependent on how you have things set up.

So if you are using PTWin, for example, and you have CslaDataPortalProxy empty, then it runs in 2-tier mode and it is the PTWin app.config where the connection strings matter.

Or if you are using PTWin and you have CslaDataPortalProxy using WCF, then the WCF configuration points to the WCF data portal host, and it is that web.config where the connection strings matter.

In a normal app the connection strings would only be in the one place they matter. In ProjectTracker they are all over the place, because I use it as a demo (and for testing) in many different physical configurations, so I just copy-paste the config settings into each file to make switching modes easier (just comment/uncomment what I need at any time).

Copyright (c) Marimer LLC