Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 January 17th, 2007, 04:43 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with connections

Hi

I downloaded an asp.net template site from MSDN. Works great on my machine. Now I want it to work on my godaddy.com web site. I just added SQL Server to my godaddy.com site and it is now enabled.

On local machine, in web.config right now there is this:

    <connectionStrings>
        <add name="pubsConnectionString1"
            connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\pubs.mdf;Integrated Security=True;User Instance=True"
            providerName="System.Data.SqlClient" />
    </connectionStrings>

My first question: what does the connection string need to look like so my app can attach this db to SQL Server on my godaddy.com site?

Second question: if I change the above connection string, I will no longer be able to develop on my local machine.. so can I have two connection strings in web.config? One for godaddy.com hosted site and one for local machine?

Any and all insight appreciated

thank you kindly

Mark

What comes up must come down. [The single-most underrated quote of all time]
__________________
What comes up must come down. [The single-most underrated quote of all time]
 
Old January 17th, 2007, 04:52 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

First your connection string will look something like this:
<add key="[keyname]" value="user ID=[username];password=[password];data source=[servername|ip address];persist security info=True;initial catalog=[name of database]"/>

Second, yes you can leave the connection string you provided in your post intact and just add a new key in the config file. You will just need to point at the SQL Server key when the site is live and at the SQLExpress key when its on your Dev box.

hth.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile
================================================== =========
 
Old January 17th, 2007, 04:59 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, So should I comment out server string when on dev box, and then comment out dev box string aach time before I publish?

What comes up must come down. [The single-most underrated quote of all time]
 
Old January 17th, 2007, 05:03 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No not unless you intend to name the keys the same thing then, in that case, yes you would always have one commented out at all times.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile
================================================== =========
 
Old January 17th, 2007, 05:18 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ty. One more question.. since I'm using an .mdf data source, don't I have to attach it in the string like the default string in my first post?

What comes up must come down. [The single-most underrated quote of all time]
 
Old January 17th, 2007, 05:23 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No. While SQL Server has MDF and LDF files where the Data and Logs, respectively, are containted you just use the Name of the database as it appears in the server.

So for: initial catalog=[name of database] it might be: initial catalog=MyWebSite

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile
================================================== =========
 
Old January 17th, 2007, 05:48 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So you can have one entry that starts off appkey and another one that starts off appname?

What comes up must come down. [The single-most underrated quote of all time]
 
Old January 17th, 2007, 05:50 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Ummm? What do you mean by appkey and appname?

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile
================================================== =========
 
Old January 17th, 2007, 06:01 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

oops sorry.. rookie mistake.. add name and add key

The default connection string is called "add name" the one you suggested is called "add key" .. just wondering if they can coexist.. and also, what is the diff between them?

ty

What comes up must come down. [The single-most underrated quote of all time]
 
Old January 17th, 2007, 06:21 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Getting this. Verfied directory is iis enabled with permissions.

Little help?


Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:

Line 43: by Microsoft that offers a single logon and core profile services for member sites.
Line 44: -->
Line 45: <authentication mode="Forms" />
Line 46:
Line 47: <!-- AUTHORIZATION


Source File: d:\hosting\danbow\application\web.config Line: 45


Show Additional Configuration Errors:

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. (d:\hosting\danbow\application\web.config line 83)

Unrecognized configuration section system.web/appSettings. (d:\hosting\danbow\application\web.config line 99)



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

What comes up must come down. [The single-most underrated quote of all time]




Similar Threads
Thread Thread Starter Forum Replies Last Post
Database - connections gkn Oracle 1 December 20th, 2005 08:25 AM
Database - connections gkn Oracle 0 December 20th, 2005 07:27 AM
Socket connections hockney General .NET 1 July 6th, 2005 04:14 AM
Connections saulodet ADO.NET 2 January 2nd, 2004 04:55 PM





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