aStill getting error update Procedure of Function 'updatecustomer' expects
parameter '@timestamp', which was not supplied.
Having looked at timestamp when it is added as a paremeter in the update
statement it is set to null, however if I look at the timestamp paremeter
when I do the initial select it is populated.
Simple form with objectdatasource and formview below, no code in aspx.cs
file at the moment. I will send the update Customer.cs class separately
because too many characters for message.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
DataObjectTypeName="Customer"
DeleteMethod="Delete" InsertMethod="Insert"
SelectMethod="Select" TypeName="Customer"
UpdateMethod="Update">
<SelectParameters>
<asp:Parameter DefaultValue="1" Name="customerID"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
</div>
<asp:FormView ID="CustomerFormView" runat="server"
DataSourceID="ObjectDataSource1" Height="218px" Style="position: static"
Width="825px" DataKeyNames="CustomerID">
<EditItemTemplate>
<table style="width: 813px; position: static">
<tr>
<td style="width: 86px; height:
24px;" valign="middle">
<asp:Label ID="Label14"
runat="server" Style="position: static" Text="Customer ID:"></asp:Label></td>
<td style="width: 154px; height:
24px;" valign="middle">
<asp:Label ID="customeridLabel1"
runat="server" Text='<%# Eval("customerid") %>' style="position: static">
</asp:Label></td>
<td style="width: 100px; height:
24px;" valign="top">
<asp:Label ID="Label28"
runat="server" Style="position: static" Text="Notes:"></asp:Label></td>
<td style="width: 100px; height:
24px;">
<asp:Label ID="UserName"
runat="server" Style="position: relative" Text='<%# User.Identity.Name %>'
Visible="False"></asp:Label>
<asp:Label ID="TimeStamp"
runat="server" Style="left: 4px; position: relative; top: 0px"
Text='<%# Eval("timestamp")
%>'></asp:Label></td>
</tr>
<tr>
<td style="width: 86px"
valign="middle">
<asp:Label ID="Label17"
runat="server" Style="position: static" Text="Name:"></asp:Label></td>
<td style="width: 154px"
valign="middle">
<asp:TextBox ID="customernameTextBox"
runat="server" Text='<%# Bind("customername") %>' style="position: static"
Width="269px"></asp:TextBox>
</td>
<td colspan="2" rowspan="8"
valign="top" align="left">
<asp:TextBox ID="detailsTextBox"
runat="server" Text='<%# Bind("details") %>' style="position: static"
Height="201px" TextMode="MultiLine" Width="416px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 86px"
valign="middle">
<asp:Label ID="Label18"
runat="server" Style="position: static" Text="Address:"></asp:Label></td>
<td style="width: 154px"
valign="middle">
<asp:TextBox ID="address1TextBox"
runat="server" Text='<%# Bind("address1") %>' style="position: static"
Width="148px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 86px"
valign="middle">
</td>
<td style="width: 154px"
valign="middle">
<asp:TextBox ID="address2TextBox"
runat="server" Text='<%# Bind("address2") %>' style="position: static">
</asp:TextBox></td>
</tr>
<tr>
<td style="width: 86px"
valign="middle">
<asp:Label ID="Label19"
runat="server" Style="position: static" Text="Town:"></asp:Label></td>
<td style="width: 154px"
valign="middle">
<asp:TextBox ID="townTextBox" runat="server"
Text='<%# Bind("town") %>' style="position: static">
</asp:TextBox></td>
</tr>
<tr>
<td style="width: 86px"
valign="middle">
<asp:Label ID="Label20"
runat="server" Style="position: static" Text="County:"></asp:Label></td>
<td style="width: 154px"
valign="middle">
<asp:TextBox ID="TextBox2"
runat="server" Style="position: relative" Text='<%# Eval("county")
%>'></asp:TextBox></td>
</tr>
<tr>
<td style="width: 86px"
valign="middle">
<asp:Label ID="Label21"
runat="server" Style="position: static" Text="Post Code:"></asp:Label></td>
<td style="width: 154px"
valign="middle">
<asp:TextBox ID="postcodeTextBox"
runat="server" Text='<%# Bind("postcode") %>' style="position: static"
Width="95px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 86px"
valign="middle">
<asp:Label ID="Label22"
runat="server" Style="position: static" Text="Country:"></asp:Label></td>
<td style="width: 154px"
valign="middle">
<asp:TextBox ID="TextBox3"
runat="server" Style="position: relative" Text='<%# Eval("country")
%>'></asp:TextBox></td>
</tr>
<tr>
<td style="width: 86px"
valign="middle">
<asp:Label ID="Label23"
runat="server" Style="position: static" Text="Phone:"></asp:Label></td>
<td style="width: 154px"
valign="middle">
<asp:TextBox ID="phoneTextBox"
runat="server" Text='<%# Bind("phone") %>' style="position: static">
</asp:TextBox></td>
</tr>
<tr>
<td style="width: 86px"
valign="middle">
<asp:Label ID="Label25"
runat="server" Style="position: static" Text="Web:"></asp:Label></td>
<td style="width: 154px"
valign="middle">
<asp:TextBox ID="webTextBox" runat="server"
Text='<%# Bind("web") %>' style="position: static">
</asp:TextBox></td>
<td style="width: 100px"
valign="middle">
<asp:Label ID="Label24"
runat="server" Style="position: static" Text="Fax:"></asp:Label></td>
<td style="width: 100px"
valign="middle">
<asp:TextBox ID="TextBox1"
runat="server" Style="position: relative" Text='<%# Bind("fax") %>'>
</asp:TextBox>
<asp:Button ID="Button2"
runat="server" CommandName="Update" Style="left: 29px; position: relative;
top: 0px" Text="Update"
/></td>
</tr>
</table>
</EditItemTemplate>
<InsertItemTemplate>
<table style="width: 814px; position:
relative">
<tr>
<td style="width: 74px">
<asp:Label ID="Label26"
runat="server" Style="position: relative" Text="Name:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="customernameTextBox"
runat="server" Text='<%# Bind("customername") %>' style="position: relative"
Width="251px"></asp:TextBox></td>
<td style="width: 100px">
<asp:Label ID="Label37"
runat="server" Style="position: relative" Text="Notes:"></asp:Label></td>
<td style="width: 100px">
<asp:Label ID="Label38"
runat="server" Style="position: relative" Text="<%# User.Identity.Name %>"
Visible="False"></asp:Label></td>
</tr>
<tr>
<td style="width: 74px">
<asp:Label ID="Label27"
runat="server" Style="position: relative" Text="Address:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="address1TextBox"
runat="server" Text='<%# Bind("address1") %>' style="position: relative">
</asp:TextBox></td>
<td colspan="2" rowspan="8"
valign="top">
<asp:TextBox ID="detailsTextBox"
runat="server" Text='<%# Bind("details") %>' style="position: relative">
</asp:TextBox></td>
</tr>
<tr>
<td style="width: 74px">
</td>
<td style="width: 100px">
<asp:TextBox ID="address2TextBox"
runat="server" Text='<%# Bind("address2") %>' style="position: relative">
</asp:TextBox></td>
</tr>
<tr>
<td style="width: 74px">
<asp:Label ID="Label30"
runat="server" Style="position: relative" Text="Town:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="townTextBox" runat="server"
Text='<%# Bind("town") %>' style="position: relative">
</asp:TextBox></td>
</tr>
<tr>
<td style="width: 74px">
<asp:Label ID="Label31"
runat="server" Style="position: relative" Text="County:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="countyTextBox"
runat="server" Text='<%# Eval("county") %>' style="position:
relative"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 74px">
<asp:Label ID="Label32"
runat="server" Style="position: relative" Text="Post Code:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="postcodeTextBox"
runat="server" Text='<%# Bind("postcode") %>' style="position: relative"
Width="92px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 74px; height:
25px;">
<asp:Label ID="Label33"
runat="server" Style="position: relative" Text="Country:"></asp:Label></td>
<td style="width: 100px; height:
25px;">
<asp:TextBox ID="countryTextBox"
runat="server" Text='<%# Eval("country") %>' style="position:
relative"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 74px">
<asp:Label ID="Label34"
runat="server" Style="position: relative" Text="Phone:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="phoneTextBox"
runat="server" Text='<%# Bind("phone") %>' style="position: relative">
</asp:TextBox></td>
</tr>
<tr>
<td style="width: 74px">
<asp:Label ID="Label35"
runat="server" Style="position: relative" Text="Fax:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="faxTextBox" runat="server"
Text='<%# Bind("fax") %>' style="position: relative">
</asp:TextBox></td>
</tr>
<tr>
<td style="width: 74px">
<asp:Label ID="Label36"
runat="server" Style="position: relative" Text="Web:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="webTextBox" runat="server"
Text='<%# Bind("web") %>' style="position: relative">
</asp:TextBox></td>
<td style="width: 100px">
<asp:Label ID="TimeStamp"
runat="server" ForeColor="Black" Style="position: relative"
Text='<%# Eval("timestamp")
%>'></asp:Label></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 74px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
<asp:Button ID="Button1"
runat="server" CommandName="Update" Style="position: relative"
Text="Update" /></td>
<td style="width: 100px">
</td>
</tr>
</table>
<br />
</InsertItemTemplate>
<ItemTemplate>
<table style="width: 800px; position: static">
<tr>
<td style="width: 93px" align="left"
valign="middle">
<asp:Label ID="Label3"
runat="server" Style="position: static" Text="Customer ID:"></asp:Label></td>
<td style="width: 194px"
align="left" valign="middle">
<asp:Label ID="customeridLabel"
runat="server" Style="position: static" Text='<%# Eval("customerid")
%>'></asp:Label></td>
<td style="width: 100px" align="left">
<asp:Label ID="Label13"
runat="server" Style="position: static" Text="Details:"></asp:Label></td>
<td style="width: 100px" align="left">
<asp:Label ID="assignedtoLabel"
runat="server" Style="position: static" Text='<%# Eval("assignedto")
%>'></asp:Label></td>
</tr>
<tr>
<td style="width: 93px" align="left"
valign="middle">
<asp:Label ID="Label4"
runat="server" Style="position: static" Text="Name:"></asp:Label></td>
<td style="width: 194px"
align="left" valign="middle">
<asp:Label
ID="customernameLabel" runat="server" Style="position: static" Text='<%#
Eval("customername") %>' ForeColor="Black"></asp:Label></td>
<td align="left" colspan="2"
rowspan="8" valign="top">
<asp:Label ID="detailsLabel"
runat="server" Style="position: static" Text='<%# Eval("details") %>'
ForeColor="Black"></asp:Label></td>
</tr>
<tr>
<td style="width: 93px" align="left"
valign="middle">
<asp:Label ID="Label5"
runat="server" Style="position: static" Text="Address:"></asp:Label></td>
<td style="width: 194px"
align="left" valign="middle">
<asp:Label ID="address1Label"
runat="server" Style="position: static" Text='<%# Eval("address1") %>'
ForeColor="Black"></asp:Label></td>
</tr>
<tr>
<td style="width: 93px; height:
21px;" align="left" valign="middle">
</td>
<td style="width: 194px; height:
21px;" align="left" valign="middle">
<asp:Label ID="address2Label"
runat="server" Style="position: static" Text='<%# Bind("address2") %>'
ForeColor="Black"></asp:Label></td>
</tr>
<tr>
<td style="width: 93px" align="left"
valign="middle">
<asp:Label ID="Label6"
runat="server" Style="position: static" Text="Town:"></asp:Label></td>
<td style="width: 194px"
align="left" valign="middle">
<asp:Label ID="townLabel"
runat="server" Style="position: static" Text='<%# Eval("town") %>'
ForeColor="Black"></asp:Label></td>
</tr>
<tr>
<td style="width: 93px" align="left"
valign="middle">
<asp:Label ID="Label7"
runat="server" Style="position: static" Text="County:"></asp:Label></td>
<td style="width: 194px"
align="left" valign="middle">
<asp:Label ID="Label1"
runat="server" ForeColor="Black" Style="position: relative"
Text='<%# Eval("county")
%>'></asp:Label></td>
</tr>
<tr>
<td style="width: 93px" align="left"
valign="middle">
<asp:Label ID="Label8"
runat="server" Style="position: static" Text="Post Code:"></asp:Label></td>
<td style="width: 194px"
align="left" valign="middle">
<asp:Label ID="postcodeLabel"
runat="server" Style="position: static" Text='<%# Eval("postcode") %>'
ForeColor="Black"></asp:Label></td>
</tr>
<tr>
<td style="width: 93px; height:
21px" align="left" valign="middle">
<asp:Label ID="Label9"
runat="server" Style="position: static" Text="Country:"></asp:Label></td>
<td style="width: 194px; height:
21px" align="left" valign="middle">
<asp:Label ID="Label2"
runat="server" ForeColor="Black" Style="position: relative"
Text='<%# Eval("country")
%>'></asp:Label></td>
</tr>
<tr>
<td style="width: 93px" align="left"
valign="middle">
<asp:Label ID="Label10"
runat="server" Style="position: static" Text="Phone:"></asp:Label></td>
<td style="width: 194px"
align="left" valign="middle">
<asp:Label ID="phoneLabel"
runat="server" Style="position: static" Text='<%# Eval("phone") %>'
ForeColor="Black"></asp:Label></td>
</tr>
<tr>
<td style="width: 93px" align="left"
valign="middle">
<asp:Label ID="Label11"
runat="server" Style="position: static" Text="Fax:"></asp:Label></td>
<td style="width: 194px"
align="left" valign="middle">
<asp:Label ID="faxLabel"
runat="server" Style="position: static" Text='<%# Eval("fax") %>'
ForeColor="Black"></asp:Label></td>
<td style="width: 100px" align="left">
<asp:Button ID="Button3"
runat="server" Style="position: relative" Text="Button" /></td>
<td style="width: 100px" align="left">
<asp:Button ID="Button4"
runat="server" CommandName="Edit" Style="position: relative"
Text="Edit" /></td>
</tr>
<tr>
<td style="width: 93px" align="left"
valign="middle">
<asp:Label ID="Label12"
runat="server" Style="position: static" Text="Web:"></asp:Label></td>
<td style="width: 194px"
align="left" valign="middle">
<asp:Label ID="webLabel"
runat="server" Style="position: static" Text='<%# Eval("web") %>'
ForeColor="Black"></asp:Label></td>
<td style="width: 100px" align="left">
</td>
<td style="width: 100px" align="left">
<asp:Label ID="Label29"
runat="server" ForeColor="Black" Style="position: relative"
Text='<%# Eval("timestamp")
%>'></asp:Label></td>
</tr>
<tr>
<td style="width: 93px" align="left"
valign="middle">
<asp:Label ID="Label15"
runat="server" Style="position: static" Text="Last Updated:"></asp:Label></td>
<td style="width: 194px"
align="left" valign="middle">
<asp:Label ID="lastupdatedLabel"
runat="server" Style="position: static" Text='<%# Eval("lastupdated") %>'
ForeColor="Black"></asp:Label></td>
<td style="width: 100px"
align="left" valign="middle">
<asp:Label ID="Label16"
runat="server" Style="position: static" Text="Update By:"></asp:Label></td>
<td style="width: 100px"
align="left" valign="middle">
<asp:Label ID="updatebyLabel"
runat="server" Style="position: static" Text='<%# Eval("updateby") %>'
ForeColor="Black"></asp:Label></td>
</tr>
</table>
</ItemTemplate>
</asp:FormView>
</form>
</body>
</html>
--
Mal Ball
"Kevin Yu [MSFT]" wrote:
Hi Mal,
Try to simplify the page with only the FormView. If with only the FormView
on that page, this problem can be reproduced, please copy and paste the
aspx and aspx.cs file here. Thank you!
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."