Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 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 27th, 2004, 12:38 AM
Registered User
 
Join Date: Oct 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trouble Connecting to Online Database

Hello,
I am really, really new to ASP.NET. I am cruising along in this book, I can get all the examples to work on my localhost, but as soon as I try to upload the ASPX file onto my remote server, everything goes south. Specifically I am trying to get the examples in Ch 8 to work online. I have uploaded the database onto the remote server (I talked to technical support at my host to make sure I had done this right) I have changed the "data source=" tag to point at the online DSN that I set up at my host--Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=anist001.data"--, but when I post the ASPX page and try it out online I get an error message telling me that: "Could not find file 'c:\windows\system32\inetsrv\anist001.data'." Does anyone know what I'm doing wrong? Is that my C: drive the file is refrencing? If so, how do I get the ASP.NET code to look for the database online? If it's not my c: drive is it the online server's? And if so why is it doing that?

Any help would be greatly appreciated.

Thanks,


 
Old October 27th, 2004, 07:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

I think you have to specify the full path for the data source. So it would be the full path to the data source for the server, not your computer. You can dynamically provide a location using String.Format, such as:

web.config has in key:

Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source={0}

objConn = New OleDbConnection(String.Format(ConfigurationSetting s.AppSettings.Get("<key>"), Server.MapPath("anist001.data")))

Brian
 
Old October 27th, 2004, 10:47 AM
Registered User
 
Join Date: Oct 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When I say I am new, I mean REALLY new. How much of that am I supposed to put in the code and where?

Thanks,

 
Old October 28th, 2004, 07:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

In the web config file, put:

<appSettings>
  <add key="Conn String" value="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=<full path to file>"/>

Specify the full path to the data source. Then when you create a new Connection object, do objConn = New OleDbConnection(ConfigurationSettings.AppSettings. Get("Conn String"))

If you are new to the ADO.NET syntax, I would check out one of the wrox books.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble connecting MySQL to PHP nofences84 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 June 14th, 2007 11:21 PM
Trouble connecting to MySQL server (CH3) mrouse BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 October 20th, 2005 01:44 PM
problem connecting to my online database umair_rathore Classic ASP Databases 1 February 9th, 2005 01:04 PM
Trouble connecting to an online database. toddbryan Classic ASP Databases 2 October 27th, 2004 12:04 AM
Trouble with connecting two table with relationshi tycoon Dreamweaver (all versions) 1 December 26th, 2003 07:21 AM





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