Database connectivity from ASP.NET pages hosted on a free web server?

This is a discussion on "Database connectivity from ASP.NET pages hosted on a free web server?" within the ASP.NET Forum section. This forum, and the thread "Database connectivity from ASP.NET pages hosted on a free web server? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > ASP.NET Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 28th, 2005, 16:04
New Member
Join Date: Nov 2005
Age: 26
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Database connectivity from ASP.NET pages hosted on a free web server?

Hi I am new to these forums and was hoping that somebody could help me out with a problem I have come across.

I have built an ASP.NET website with C# coding which queeries an Access database. I have tested it thoroughly on the web matrix test server and the functionality is all working. I now want to upload the pages to an online webserver so that they can be accessed from any computer.

I am trying to find out whether the only changes I need to make are in the connection string in the web.config file; or if I need to do something else.

Here is my web.config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectionString"
value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Assignment\\magazine.mdb" />
</appSettings>
</configuration>


If it is just a case of changing the ConnectionString then please could someone advise me on the changes I have to make. Any suggestions are welcome.

I have looked at a lot of Googled ASP.NET help sites and have found myself going round in circles for hours and not getting a solution.

Many thanks
Jon
Reply With Quote

  #2 (permalink)  
Old Nov 28th, 2005, 20:33
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbramz
Re: Database connectivity from ASP.NET pages hosted on a free web server?

i dont really understand the question - but from what i gather, your your moving your pages and database to a server somwhere, not your local machine?

in that case would you need to change the connection string to server.mappath ....
for example, :

Code: Select all
data source=" & server.mappath("db.mdb"))

Last edited by benbramz; Nov 28th, 2005 at 20:39.
Reply With Quote
  #3 (permalink)  
Old Nov 29th, 2005, 12:06
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Database connectivity from ASP.NET pages hosted on a free web server?

You need to know the full path to your database when it is on your live website, the easiest way to do this is to create a simple .asp page, insert the following code, and upload it:

Code: Select all
<%=Request.ServerVariables("PATH_TRANSLATED")%>
when you view this page it will give you something like:

e:\sites\domain.com\web\

This is the path you'll need to use in your Web.Config file, for example:

<add key="ConnectionString"
value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\sites\domain.com\web\magazine.mdb" />
Reply With Quote
  #4 (permalink)  
Old Nov 30th, 2005, 18:49
New Member
Join Date: Nov 2005
Age: 26
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Database connectivity from ASP.NET pages hosted on a free web server?

Thanks BenBramz and Smokie for the replies.
I have sorted the problem now. Many thanks to Smokie who I wrongly read his advice and made a simple .aspx page instead of a simple .asp page.
It is sorted now: many thanks.
Jon

Last edited by JKidd32; Dec 5th, 2005 at 12:17.
Reply With Quote
Reply

Tags
database, connectivity, aspnet, pages, hosted, free, web, server

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
24/7 connectivity? goldy Webforumz Cafe 18 Sep 9th, 2007 17:59
XML Code for transfering data from one SQL Server Database to another database plolla Other Programming Languages 1 Aug 3rd, 2006 18:37
Excel to SQL Server database madhuri.t Classic ASP 7 Jun 15th, 2006 20:45
Uploading Access Database and ASP Pages dinahdoey Classic ASP 4 Sep 6th, 2004 20:45


All times are GMT. The time now is 22:35.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43