Newbie needs help, configuring web.config to point at sql server

Newbie needs help, configuring web.config to point at sql server

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


mindless posted on Monday, October 27, 2008

I've downloaded the sample VB application (cslavb-3.0.5-081009.zip) and am interested in getting the PTWeb site up and running, but I don't want to use the sql express databases that come with the sample.

I would rather set it up to use sql server 2005, can anyone tell me what changes I need to make to the web.config file so that it will attempt to connect to a server through a connection string.

p.s. I don't know if anyone has already created a sql script to create the sample database in sql server, has anyone tried doing this yet?

any help is appreciated.

mindless replied on Monday, October 27, 2008

Ah, found the scripts in the zip file, thats one thing out the way.

Now I have changed the connection strings to point to the server. and I am encountering an error

"The remote server returned an error: (401) Unauthorized."

Line 76:       Return DataPortal.Fetch(Of PTIdentity)(New Criteria(username, password))

Source File:
c:\inetpub\wwwroot\CSLA2\App_Code\ProjectTracker\Security\PTIdentity.vb    Line: 76

Any ideas what this means?

Also i notice a section in the web.config which I don't recognise.

  <system.serviceModel>
    <client>
      <endpoint name="WcfDataPortal"
                address="http://localhost:4216/WcfHost/WcfPortal.svc"
                binding="wsHttpBinding"
                contract="Csla.Server.Hosts.IWcfPortal" />
    </client>
  </system.serviceModel>

Whats this do? and is it necessary or can I take it out.

mindless replied on Monday, October 27, 2008

Well I took it out, and commented out the
<add key="CslaDataPortalProxy"
         value="Csla.DataPortalClient.WcfProxy, Csla"/>
key from appSettings

and now i've got the demo running. I managed to find help on page 526 which pointed me in the right direction. Turns out I needed to disable the remote data portal which I had no need for.

Is there any performance or security costs/benifits to using this local data portal approach instead of a remote one?

JoeFallon1 replied on Monday, October 27, 2008

"Is there any performance or security costs/benefits to using this local data portal approach instead of a remote one?"

Yes.

Local is faster.

Remote is more secure but slower. For example you could have a web server in the DMZ which is open to the Internet. It should be forbidden to access a database on the inside of the Corporate firewall. So it will use the remote dataportal to talk to another web server inside the firewall and that web server will contact the database. This way if the web server in the DMZ is hacked they can't get to the database.

Joe

 


 

mindless replied on Tuesday, October 28, 2008

Thanks for the advice, I can now see where that would be useful to have.

Copyright (c) Marimer LLC