Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 25th, 2004, 09:52 PM
Registered User
 
Join Date: Oct 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connection String

I am developing on my desktop and have the database on a serperate server located on the network.

This is a home network.

I want to develop and test my code from my desltop but i keep getting a connection error. Database cannot be found or login is wrong. Something along those lines.

i use .Net framwork to develop my database and am connected to it. I use the same server name, UN, and password for the application as i do for the database connection through .NET framwork.

this is the Connection from web.config:
    <sessionState
            mode="InProc"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data source=ServerName;database=ThePhile; user Id=xxxx;password=xxxx"
            cookieless="false"
            timeout="20"
    />

I also tried the IP address instead of the server name. 198.160.2.0 but that didn;t work either.

Here is the connection from the Poll.config file:
<ConnectionString>server=ServerName;database=ThePh ile;uid=xxxx;pwd=xxxx;</ConnectionString>

what is it that i am doing wrong?


-Jason
 
Old October 26th, 2004, 12:20 AM
Authorized User
 
Join Date: Oct 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is the Database install an MSDE Install (Microsoft Desktop Edition of SQL Server) or SQL Server.

With the SQLServer install the system defaults to a security model that uses your windows login as the login to the Database. You might have to change the security model of the database. There is an article on MSDN to do this. The other way is to configure the ASP.Net user to use a valid windows user account, and configure that account to have permissions on the Database in Question.

Do a search on MSDN on using Trusted connections in ASP.NET there are a few articles on it.
 
Old October 26th, 2004, 10:19 AM
Registered User
 
Join Date: Oct 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using SQL Server. I will look up that solution and let you know how it goes.

Thank you..


-Jason
 
Old October 26th, 2004, 04:04 PM
Authorized User
 
Join Date: Oct 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you are useing SQL Server one thing to try just to see if the system works is to create a user for the system.

Go to your enterprise manager for SQL Server, and right click on the main server icon, this will show the database properties, from there you should see nine tabs go to the security TAB. See the sectiopn where it says authentication, to use a SQL Server account as in the connection string designed in the book we need to make sure that the Security model is set to SQL Serever and Windows.

Net step open the Database Server icon and go to the security section in the MMC for Enterprise manager, go to logons and right click and select New logon. Follow the main screen (You should be able to work it out), and create a logon. Next you will have to go to the Database roles for the user you just created, make sure that the use has access to connect to the DB in question and on the bottom pain has the public role selected.

The final stage is that you will have to go to the Database (ThePhile) and make sure that all of the permissions are set correctly. Select Each User object (Tables and Stored Procs) and on the tabls set all of the permissions so that they all have a green tick in the box. For the Stored procs you need to make sure that exec has the green tick.

Now you should be able to change the connection string in your web config to reflect the user name and password that you selected..

Then Try the App.

 
Old October 26th, 2004, 04:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jason -

The real connection string is stored in every one of the .config files in the config subdirectory. That connection string in web.config is not used, since we're not using SQL Server session state.

By the way, did you create "ThePhile" database by following the directions with the code download (restoring from the backup file)?

Eric
 
Old November 1st, 2004, 02:06 AM
Registered User
 
Join Date: Oct 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got it. I had to use impersonation in the web.comfig file.


-Jason





Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection string MunishBhatia ASP.NET 2.0 Professional 4 May 16th, 2007 05:50 AM
Connection String jmss66 Oracle 4 August 8th, 2006 03:19 AM
Connection String slgknjn VB Databases Basics 2 February 26th, 2005 03:14 AM
Connection String fs22 Classic ASP Databases 3 August 30th, 2004 01:25 AM
Connection String Help. diamond2165 BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 7th, 2003 06:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.