My crazy GridView !!
I am using Visual Studio 2005, I have a problem with my GridView.
I have one access .mdb table and when I update a record on the table
EVERYTHING is perfect. I made a Web Setup Project and installed My Web
Application on my Localhost and it works perfectly.
When I install My Web Application on our “Production Server” it just doesn’t
update the records on Edit mode!!!
I open the table with Access, update the records manually, and refresh… the
GridView is updated and cached my manual changes?
I tried to add ALL Users and grant Full Control on the Security Tab of the
used table, NO WAY, it didn’t help!!
No errors no messages, just doesn’t update the records.
Any help please ???
No code behind code, Here is my “default.aspx”…
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Welcome to Availibility Form</title>
</head>
<body>
<script type="text/javascript" language="JavaScript1.2">
<!--
//HV Menu-
//Submitted
//Visit http://www.dynamicdrive.com for this script and more
function Go(){return}
// -->
</script>
<script type="text/javascript" src="exmplmenu_var.js"></script>
<script type="text/javascript" src="menu_com.js"></script>
<noscript>
Your browser does not support script
</noscript>
<SCRIPT Language=VBScript>
function VisDato
dim Dag, TheDato, nu
nu = now
Dag = WeekdayName(Weekday(nu, vbUseSystemDayOfWeek), false,
vbUseSystemDayOfWeek)
TheDato = Dag & ", " & FormatDateTime(nu, vbLongDate)
TheDato = replace(TheDato, Dag & ", " & Dag, Dag)
dato.innerText = TheDato
end function
</SCRIPT>
<br>
<table class="maintable" width=820 border="0" align="center" cellpadding="0"
cellspacing="0" bgcolor="white">
<tr>
<td bgcolor="white" align="left"><img src="logo_one_line.gif"></td>
<!-- URET -->
<td align=right bgcolor="white">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td>Welcome 7TM Empolyee</td></tr>
<tr><td align="center"><span id=dato></span></td></tr>
</table>
</td>
<TD> </TD>
<TD align=right><a href="http://www.dmi.dk/dmi/index/danmark.htm"
title="Weather forecast. Click to see weather in details."><img
border="0"
src="http://glwww.dmi.dk/vejr/landsudsigter/1day.gif"></a></TD>
</tr>
</table>
<SCRIPT LANGUAGE=VBScript>
VisDato
setInterval "VisDato", 10000, "VBScript"
</SCRIPT>
<form id="form1" runat="server">
<div>
<table align="center">
<tr>
<td style="height: 77px; width: 800px;" align="left">
<strong><span style="text-decoration: underline"
contenteditable="false">Welcome to the Availability Form</span></strong> <br
/>
</td>
</tr>
<tr>
<td style="height: 63px; width: 800px; text-align: left;"
align="left">
<span style="font-size: 10pt; font-family: Arial">Please
click on the <strong><span
style="text-decoration: underline"><span
style="color: blue">Edit</span> </span>
</strong>link beside your name to start editing your
<strong>Availability</strong> Status
and select the <strong>Dates </strong>and
<strong>Times </strong>of your <strong>Leaving
</strong>and <strong>Return</strong>, and then click
<strong>Update</strong>. </span></td>
</tr>
<tr>
<td style="height: 104px; width: 800px;">
<asp:GridView ID="GridView1" runat="server"
AllowSorting="True" AutoGenerateColumns="False"
BackColor="#73A3D3" DataKeyNames="ID"
DataSourceID="AccessDataSource1" EmptyDataText="There are no data records to
display."
Font-Size="Medium" Width="800px">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="Name"
HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Department"
HeaderText="Department" SortExpression="Department" />
<asp:BoundField DataField="Availability"
HeaderText="Availability" SortExpression="Availability" />
<asp:BoundField DataField="LeaveDate"
HeaderText="Leave Date" SortExpression="LeaveDate" />
<asp:TemplateField HeaderText="Leave Time"
SortExpression="LeaveTime">
<ItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# Eval("LeaveTime") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1"
runat="server" SelectedValue='<%# Bind("LeaveTime") %>'>
<asp:ListItem
Selected="True"></asp:ListItem>
<asp:ListItem>All Day</asp:ListItem>
<asp:ListItem>08:00</asp:ListItem>
<asp:ListItem>09:00</asp:ListItem>
<asp:ListItem>10:00</asp:ListItem>
<asp:ListItem>11:00</asp:ListItem>
<asp:ListItem>12:00</asp:ListItem>
<asp:ListItem>13:00</asp:ListItem>
<asp:ListItem>14:00</asp:ListItem>
<asp:ListItem>15:00</asp:ListItem>
<asp:ListItem>16:00</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ReturnDate"
HeaderText="Return Date" SortExpression="ReturnDate" />
<asp:TemplateField HeaderText="Return Time"
SortExpression="ReturnTime">
<ItemTemplate>
<asp:Label ID="Label2" runat="server"
Text='<%# Bind("ReturnTime") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DropDownList2"
runat="server" SelectedValue='<%# Bind("ReturnTime") %>'>
<asp:ListItem
Selected="True"></asp:ListItem>
<asp:ListItem>All Day</asp:ListItem>
<asp:ListItem>09:00</asp:ListItem>
<asp:ListItem>10:00</asp:ListItem>
<asp:ListItem>11:00</asp:ListItem>
<asp:ListItem>12:00</asp:ListItem>
<asp:ListItem>13:00</asp:ListItem>
<asp:ListItem>14:00</asp:ListItem>
<asp:ListItem>15:00</asp:ListItem>
<asp:ListItem>16:00</asp:ListItem>
<asp:ListItem>17:00</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="#80B6EC" />
<RowStyle Wrap="False" />
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1"
runat="server" DataFile="App_Data\who_is_who_available.mdb"
DeleteCommand="DELETE FROM [who_is_who_available]
WHERE [ID] = ?" InsertCommand="INSERT INTO [who_is_who_available] ([ID],
[Name], [Title], [Department], [Availability], [LeaveDate], [LeaveTime],
[ReturnDate], [ReturnTime], [Init]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
SelectCommand="SELECT * FROM [who_is_who_available]
ORDER BY [Department], [Name]"
UpdateCommand="UPDATE [who_is_who_available] SET
[Name] = ?, [Title] = ?, [Department] = ?, [Availability] = ?, [LeaveDate] =
?, [LeaveTime] = ?, [ReturnDate] = ?, [ReturnTime] = ?, [Init] = ? WHERE [ID]
= ?">
<DeleteParameters>
<asp:Parameter Name="original_ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Department" Type="String" />
<asp:Parameter Name="Availability" Type="String"
/>
<asp:Parameter Name="LeaveDate" Type="String" />
<asp:Parameter Name="LeaveTime" Type="String" />
<asp:Parameter Name="ReturnDate" Type="String" />
<asp:Parameter Name="ReturnTime" Type="String" />
<asp:Parameter Name="Init" Type="String" />
<asp:Parameter Name="original_ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="ID" Type="Int32" />
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Department" Type="String" />
<asp:Parameter Name="Availability" Type="String"
/>
<asp:Parameter Name="LeaveDate" Type="String" />
<asp:Parameter Name="LeaveTime" Type="String" />
<asp:Parameter Name="ReturnDate" Type="String" />
<asp:Parameter Name="ReturnTime" Type="String" />
<asp:Parameter Name="Init" Type="String" />
</InsertParameters>
</asp:AccessDataSource>
</td>
</tr>
<tr>
<td align="center" style="height: 60px; width: 800px;">
©2006 ...... All All rights reserved.
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
--
Aws
aw***@yahoo.com