ASP.NET ? (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


MCD -> ASP.NET ? (6/17/2008 11:31:58)

I created a simple Access database and used Expression Web's ASP.NET controls on an .aspx. The code works fine on my local machine running Vista's Developmental Server. Can anyone tell me why this code is not working on a server running ASP.NET 2.0?

<form id="form1" runat="server">
<asp:DataList runat="server" id="DataList1" DataSourceID="AccessDataSource1">
<ItemTemplate>
FName:
<asp:Label Text='<%# Eval("FName") %>' runat="server" id="FNameLabel" /><br />
LName:
<asp:Label Text='<%# Eval("LName") %>' runat="server" id="LNameLabel" /><br />
Town:
<asp:Label Text='<%# Eval("Town") %>' runat="server" id="TownLabel" /><br />
<br />
</ItemTemplate>
</asp:DataList>
<asp:AccessDataSource runat="server" ID="AccessDataSource1" DataFile="App_Data/test.mdb" SelectCommand="SELECT [FName], [LName], [Town] FROM [names]">
</asp:AccessDataSource>
</form>

</body>




swoosh -> RE: ASP.NET ? (6/17/2008 12:18:41)

quote:

DataFile="App_Data/test.mdb"


Is the above the correct location of the database on the server?




MCD -> RE: ASP.NET ? (6/17/2008 13:41:45)

Yes it is. It's baffling to me.




swoosh -> RE: ASP.NET ? (6/17/2008 13:49:59)

Where is that directory precisely from the root?




MCD -> RE: ASP.NET ? (6/17/2008 14:01:45)

Swoosh, the entire path is:

http://www.martinscomputerdesigns.com/App_Data/test.mdb

This is just test info. There is nothing important in it. The database is just data for a test.





swoosh -> RE: ASP.NET ? (6/17/2008 14:14:32)

And where is the aspx page located on the server?




MCD -> RE: ASP.NET ? (6/17/2008 14:55:27)

The aspx page is in the root.
http://www.martinscomputerdesigns.com/test1.aspx




swoosh -> RE: ASP.NET ? (6/17/2008 15:12:10)

Try changing the code of the path to the following and see what happens:

~/App_Data/test.mdb

don't forget to upload the new file path to the server

and leave the quotes surrounding the path also




MCD -> RE: ASP.NET ? (6/17/2008 15:36:11)

quote:


~/App_Data/test.mdb


I changed DataFile="App_Data/test.mdb" to DataFile="~/App_Data/test.mdb" and I still got a runtime error.

Could it be my host is mistaken about the ASP.NET 2.0?
If it's working on my system, shouldn't it work on a ASP.NET 2.0 server?




swoosh -> RE: ASP.NET ? (6/17/2008 15:39:47)

quote:

If it's working on my system, shouldn't it work on a ASP.NET 2.0 server?


Yes it should.....that's how I test mine. If I preview in broswer from EW and it works, I upload and there is no problem when I check the actual page online.

Yes, they can be mistaken, sometimes they have to reinstall them if things aren't configured properly. It has happen to me a few times and the host says hold on let me reinstall and viola! what didn't work once suddenly does.




MCD -> RE: ASP.NET ? (6/17/2008 16:09:17)

I am going to move the site over to a better hosting company and try it. We may be beating our brains in for nothing. Everything I tested works on my local machine.

Thanks for your help. I'll post the results when the site is moved and tested.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
6.054688E-02