p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

aspdotnet_website_programming thread: Connecting to a hosted SQL Server


Message #1 by "Ric Clarke" <ric@l...> on Fri, 10 Jan 2003 17:12:57
My problem relates to connecting to the database on a remote hosted 
server. 

I've set up a MS SQL 2000 database locally using the technique as 
described in the book  (asp.net website programming  Problem ? design ? 
solution )with the connection string stored in a separate '.config' file 
for each module (below), and this works great:

<?xml version="1.0"?>
<ModuleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ConnectionString>server
(local);database=Mytestdbs;uid=sa;pwd=MyPassword;</ConnectionString>
</ModuleSettings> 


However I've recently signed up with www.baskethost.com . They supply a 
MS SQL 2000 Database and supply the following connection string to use:

Provider=SQLOLEDB.1;Persist Security Info=True;User 
ID=MyUserID;Password=MyPassword;Initial Catalog=Mytestdbs;Data 
Source=sql3.hostbasket.com

So I've amended my config file as:

<?xml version="1.0"?>
<ModuleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ConnectionString> Provider=SQLOLEDB.1;Persist Security Info=True;User 
ID=MyUserID;Password=MyPassword;Initial Catalog=Mytestdbs;Data 
Source=sql3.hostbasket.com
</ConnectionString>
</ModuleSettings> 

This does not seem to work.

Any help or advice would be greatly appreciated.

Thanks in advance
Message #2 by "Scott Willsey" <hangtown@t...> on Fri, 10 Jan 2003 09:16:27 -0800
Just modify it so it looks like theirs...

<ConnectionString>server=sql3.hostbasket.com;database=Mytestdbs;UID=MyUs
erID;PWD=MyPassword</ConnectionString>

Really, all you needed to change was the server name, user id and the
password, not the format of your config file entry.

-----Original Message-----
From: Ric Clarke [mailto:ric@l...] 
Sent: Friday, January 10, 2003 5:13 PM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] Connecting to a hosted SQL
Server


My problem relates to connecting to the database on a remote hosted 
server. 

I've set up a MS SQL 2000 database locally using the technique as 
described in the book  (asp.net website programming  Problem - design - 
solution )with the connection string stored in a separate '.config' file

for each module (below), and this works great:

<?xml version="1.0"?>
<ModuleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ConnectionString>server
(local);database=Mytestdbs;uid=sa;pwd=MyPassword;</ConnectionString>
</ModuleSettings> 


However I've recently signed up with www.baskethost.com . They supply a 
MS SQL 2000 Database and supply the following connection string to use:

Provider=SQLOLEDB.1;Persist Security Info=True;User 
ID=MyUserID;Password=MyPassword;Initial Catalog=Mytestdbs;Data 
Source=sql3.hostbasket.com

So I've amended my config file as:

<?xml version="1.0"?>
<ModuleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ConnectionString> Provider=SQLOLEDB.1;Persist Security Info=True;User 
ID=MyUserID;Password=MyPassword;Initial Catalog=Mytestdbs;Data 
Source=sql3.hostbasket.com
</ConnectionString>
</ModuleSettings> 

This does not seem to work.

Any help or advice would be greatly appreciated.

Thanks in advance
---
Professional Design Patterns in VB.NET: 
Building Adaptable Applications

Want to know how design patterns bring reusable 
design and adaptabilty to your applications? How 
to recognize the need for a design pattern 
solution? How to select, design, and implement 
the right patterns? How parts of the .NET Framework 
(like the .NET Data Providers and .NET Remoting) 
take advantage of design patterns? This book 
presents a practical approach to using design 
patterns in VB.NET, by focusing on the relevance 
of design patterns in the different tiers of a 
distributed n-tier architecture. 

http://www.wrox.com/books/1861006985.htm





  Return to Index