I do not have direct access to the server to find the actual version info. I only know it is running on an AIX box.
I am trying to fix someone elses work, not sure where the problem lies. I have a small web portal that works fine for browsing the data, but when trying to do an update gives the above error.
I have this code in the <script> section of the page:
Code:
protected void DetailsView_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
{
// Iterate though the values entered by the user and HTML encode
// the values. This helps prevent malicious values from being
// stored in the data source.
for (int i = 0; i < e.NewValues.Count; i++)
{
if (e.NewValues[i] != null)
{
e.NewValues[i] = Server.HtmlEncode(e.NewValues[i].ToString());
}
}
}
and this code in the body of the page:
Code:
<asp:SqlDataSource
ID="sqlDetails" runat="server"
Connectionstring="<%$ Connectionstrings:apples %>"
ProviderName="<%$ Connectionstrings:apples.ProviderName %>"
SelectCommand="
select
a.account_id,
a.account_code,
a.account_name,
a.account_policy,
a.account_target,
a.account_workitem,
a.start_date,
a.kit_date,
a.upgrade_date,
a.approval_date,
a.sunset_date,
a.alert_flag,
a.cirats_flag,
a.report_flag,
a.sample_flag,
a.sample_rate,
d.department_id,
d.department_code
from
account a,
department d
where d.department_id = a.department_id
and a.account_code = ?
"
UpdateCommand="
update account set
account_name = ?,
account_policy = ?,
account_target = ?,
account_workitem = ?,
kit_date = ?,
upgrade_date = ?,
approval_date = ?,
sunset_date = ?,
alert_flag = ?,
cirats_flag = ?,
report_flag = ?,
sample_flag = ?,
sample_rate = ?,
department_id = ?
where account_id = ?"
<UpdateParameters>
<asp:Parameter Name="account_name" Type="string" />
<asp:Parameter Name="account_policy" Type="string" />
<asp:Parameter Name="account_target" Type="Int16" />
<asp:Parameter Name="account_workitem" Type="string" />
<asp:Parameter Name="kit_date" Type="DateTime" />
<asp:Parameter Name="upgrade_date" Type="DateTime" />
<asp:Parameter Name="approval_date" Type="DateTime" />
<asp:Parameter Name="sunset_date" Type="DateTime" />
<asp:Parameter Name="alert_flag" Type="string" />
<asp:Parameter Name="cirats_flag" Type="string" />
<asp:Parameter Name="report_flag" Type="string" />
<asp:Parameter Name="sample_flag" Type="string" />
<asp:Parameter Name="sample_rate" Type="Int16" />
<asp:Parameter Name="department_id" Type="Int16" />
<asp:Parameter Name="account_id" Type="Int16" />
</UpdateParameters>
I have never seen this way of building an SQL statement before. Strangely, sometimes the update works, and we can go into the database and update the field directly with no problem. I think there may be an issue with some of the fields having null values, but at this point I'm grasping at straws.
Any help will be appreciated.