 |
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
|
|
|
|
|

October 27th, 2004, 12:38 AM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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,
|
|

October 27th, 2004, 07:05 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
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
|
|

October 27th, 2004, 10:47 AM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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,
|
|

October 28th, 2004, 07:36 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
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
|
|
 |