Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gridview - Blank Page

Status
Not open for further replies.

jeffsal

Technical User
Oct 29, 2005
24
US
I created a gridview page which displays the data properly on the local machine but when uploaded to web server shows a blank page with no errors. The web server supports asp.net. I put some text on the page which did show but no gridview. With no errors, I don't know what could be wrong. Here is the code:

<HTML>
<HEAD>


</HEAD>

<BODY>
<form id="form1" runat="server">
<asp:AccessDataSource id="AccessDataSource1" runat="server" DataFile="varsity.mdb" SelectCommand="SELECT [Field1], [Field2], [Field3], [Field4], [Field5], [Field6] FROM [Varsity3]">
</asp:AccessDataSource>

<asp:GridView id="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource1">
<Columns>
<asp:boundfield DataField="Field1" HeaderText="Field1" SortExpression="Field1">
</asp:boundfield>
<asp:boundfield DataField="Field2" HeaderText="Field2" SortExpression="Field2">
</asp:boundfield>
<asp:boundfield DataField="Field3" HeaderText="Field3" SortExpression="Field3">
</asp:boundfield>
<asp:boundfield DataField="Field4" HeaderText="Field4" SortExpression="Field4">
</asp:boundfield>
<asp:boundfield DataField="Field5" HeaderText="Field5" SortExpression="Field5">
</asp:boundfield>
<asp:boundfield DataField="Field6" HeaderText="Field6" SortExpression="Field6">
</asp:boundfield>
</Columns>
</asp:GridView>
</form>


</BODY>
</HTML>
 
Its may seema silly question but are you uploading the access database file to the same place?
 
Yes I did. I also checked permissions on both files.
 
check the IIS logs for errors related to asp.net. for Access to open the database it must write a lock file. when the connection is closed the lock file is deleted. if the account operating IIS doesn't have read/write permissions the db may not be opening, and silently failing.

also is MS Office installed on the server? I'm pretty sure this is required for asp.net to know how to access the database.

I would also recommend changing databases. Access is a poor choice for web development.
1. it's meant to be a local (not remote) single user database
2. it requires read/write permissions with the locking file
3. it's very insecure
4. there is no transaction management
5. It's analogous to putting a go-kart on a freeway

If you need a no cost database look into SqlExpress (preferred), MySql or SqLite.

I would also recommend not using any of the drag/drop datasource controls. You cannot debug them. when you encounter errors there is no way to step through (or log) what is happening. there is also no way to add logic to them when the requirements change in the future.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top