New to the ASP.net forums here, and have recently started tinkering with the Visual Studio Express suite. I have a ASP.Net website in Web Developer that "talks" to an access database, through the webform you're able to edit, delete, add new items in the access database. The error comes into play whenever I try to edit an existing record, it gives me an error stating 'No value given for one or more required parameters'. I am able to add new records and they populate in the access database without a problem.
I've seen a number of other topics on this, but I'm not certain how to apply the solutions from their problem to mine.
Any help would be greatly appreciated!!
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="AccessEdit.aspx.vb" Inherits="AccessEdit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>
Edit Access</h1>
</div>
<asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True"
AutoGenerateRows="False" BackColor="White" BorderColor="#E7E7FF"
BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="Terminal"
DataSourceID="AccessDataSource1" GridLines="Horizontal" Height="50px"
Width="613px">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
<Fields>
<asp:BoundField DataField="Employee_ID" HeaderText="Employee_ID"
SortExpression="Employee_ID" />
<asp:BoundField DataField="First_Name" HeaderText="First_Name"
SortExpression="First_Name" />
<asp:BoundField DataField="Last_Name" HeaderText="Last_Name"
SortExpression="Last_Name" />
<asp:BoundField DataField="Terminal_Name" HeaderText="Terminal_Name"
SortExpression="Terminal_Name" />
<asp:BoundField DataField="Terminal" HeaderText="Terminal" ReadOnly="True"
SortExpression="Terminal" />
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True"
ShowInsertButton="True" />
</Fields>
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" />
</asp:DetailsView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="C:\Documents and Settings\User\Desktop\Access Database\Access Edit\App_Data\Access Database.mdb"
DeleteCommand="DELETE FROM [Castrminfo] WHERE (([Terminal] = ?) OR ([Terminal] IS NULL AND ? IS NULL))"
InsertCommand="INSERT INTO [Castrminfo] ([Employee ID], [First Name], [Last Name], [Terminal Name], [Terminal]) VALUES (?, ?, ?, ?, ?)"
SelectCommand="SELECT [Employee ID] AS Employee_ID, [First Name] AS First_Name, [Last Name] AS Last_Name, [Terminal Name] AS Terminal_Name, [Terminal] FROM [Castrminfo]"
UpdateCommand="UPDATE [Castrminfo] SET [Employee ID] = ?, [First Name] = ?, [Last Name] = ?, [Terminal Name] = ? WHERE (([Terminal] = ?) OR ([Terminal] IS NULL AND ? IS NULL))">
<DeleteParameters>
<asp:Parameter Name="Terminal" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Employee_ID" Type="String" />
<asp:Parameter Name="First_Name" Type="String" />
<asp:Parameter Name="Last_Name" Type="String" />
<asp:Parameter Name="Terminal_Name" Type="String" />
<asp:Parameter Name="Terminal" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Employee_ID" Type="String" />
<asp:Parameter Name="First_Name" Type="String" />
<asp:Parameter Name="Last_Name" Type="String" />
<asp:Parameter Name="Terminal_Name" Type="String" />
<asp:Parameter Name="Terminal" Type="Int32" />
</InsertParameters>
</asp:AccessDataSource>
<br />
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" BackColor="White" BorderColor="#E7E7FF"
BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="Terminal"
DataSourceID="AccessDataSource1" GridLines="Horizontal" Height="315px"
Width="614px">
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="Employee_ID" HeaderText="Employee_ID"
SortExpression="Employee_ID" />
<asp:BoundField DataField="First_Name" HeaderText="First_Name"
SortExpression="First_Name" />
<asp:BoundField DataField="Last_Name" HeaderText="Last_Name"
SortExpression="Last_Name" />
<asp:BoundField DataField="Terminal_Name" HeaderText="Terminal_Name"
SortExpression="Terminal_Name" />
<asp:BoundField DataField="Terminal" HeaderText="Terminal" ReadOnly="True"
SortExpression="Terminal" />
</Columns>
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" />
</asp:GridView>
</form>
</body>
</html>