Wrox Programmer Forums
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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 May 23rd, 2012, 05:44 AM
Authorized User
 
Join Date: Mar 2012
Posts: 59
Thanks: 2
Thanked 4 Times in 4 Posts
Default Configuring Connection Strings

Hi All,

I am a bit lost on this one. My web host is 123-reg and I have created a database on their host to store the data as per the Beginning ASP.NET Book by Imar. The connection strings currently configured in the web.config file are as follows:-

Code:
<connectionStrings>
    <add name="PlanetWroxConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\PlanetWrox.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
    <add name="PlanetWroxEntities" connectionString="metadata=res://*/App_Code.PlanetWrox.csdl|res://*/App_Code.PlanetWrox.ssdl|res://*/App_Code.PlanetWrox.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\PlanetWrox.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
Nothing new there really, but below is the connection information I have been provided by 123-reg for connecting to there web database. There are 3 options which are:-

Connection string (ASP.net)
Code:
<appSettings>
<add key="ConnectionString" value="Server=ATLAS-SQL-07; Database=bionatureagricultur_XXXXXX_db1; User Id=ubio_XXXXXX_0001; Password=XXXXXXXX" />
</appSettings>
Connection string (classic ASP: OLE)
Code:
myConnectionString="Provider=sqloledb;DataSource=ATLAS-SQL-07; Initial Catalog=bionatureagricultur_XXXXXX_db1; User Id=ubio_XXXXXX_0001; Password=XXXXXXXX;"
Connection string (classic ASP: ADO)
Code:
myConnectionString="Driver={SQL Server};Server=ATLAS-SQL-07;Database=bionatureagricultur_XXXXXX_db1;User Id=ubio_XXXXXX_0001;Password=XXXXXXXX;"
With still being new to ASP and only really knowing what Imar has taught me so far I have no idea where to start in modifying the original connection strings to accommodate the information from 123-reg.

Can anyone therefore give me any advice as to where to begin?

Thanks in advance for any help.

Kind regards,

Ian Ryder.
 
Old May 23rd, 2012, 12:05 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

HI there,

Take the connection string from the example that uses appSettings (e.g. take the value) and put that in the connectionString attribute of your connectionStrings section in web.config.

No idea why they are suggesting to use appSettings instead of connectionStrings which is designed exactly for that purpose.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old May 24th, 2012, 01:07 AM
Authorized User
 
Join Date: Mar 2012
Posts: 59
Thanks: 2
Thanked 4 Times in 4 Posts
Default Tried and Failed

Hi Imar,

Thanks for your comments and guidence once more. I have tried your solution in my connection strings and as I expected with 123-reg (not trying to belittle them) but I got nowhere. What I mean is there is no communication between the site and the databases and more frustratingly no error messages to try and pinpoint what's wrong.

I dont think there is much more you can help me with on this one so I have posted the issue with 123-reg to see is they can see why I am not communicating with their databases. I will let you know how I get on when they come back to me.

Cheers

Ian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection strings arun_babu_a BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 November 1st, 2011 12:52 PM
Connection Strings WFletch Visual Basic 2008 Essentials 1 July 14th, 2008 09:42 AM
Securing connection strings haines ASP.NET 2.0 Basics 1 March 2nd, 2008 04:28 PM
Connection Strings WillyWonker BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 3 January 25th, 2005 10:40 AM
Connection Strings hcweb Classic ASP Basics 6 September 23rd, 2004 03:29 AM





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