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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Must declare the scalar variable "@ID". HELP please, thanks ahead.

Status
Not open for further replies.

33788

IS-IT--Management
Mar 15, 2005
97
US
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Must declare the scalar variable "@ID".

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): Must declare the scalar variable "@ID".]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857370
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734982
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +192
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +380
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +401
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues) +720
System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +75
System.Web.UI.WebControls.DetailsView.HandleDelete(String commandArg) +830
System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +556
System.Web.UI.WebControls.DetailsView.RaisePostBackEvent(String eventArgument) +194
System.Web.UI.WebControls.DetailsView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
 
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
<html xmlns=" >
<head runat="server">
<title>Hotsheet - Project Detail (Drop-Down List)</title>
<style type="text/css">
<!--
.style1 {
font-family: "Trebuchet MS";
font-size: 14px;
}
-->
</style>
</head>

<body>
<table width="800" border="0">
<tr>
<td><span style="font-size: 22pt; color: #990000; font-family: Trebuchet MS"><strong><span style="font-size: 11pt; color: #000000">
<asp:ImageMap ID="ImageMap1"
runat="server" ImageUrl=" <asp:RectangleHotSpot
NavigateUrl=" Left="400"
Top="40"
Right="460"
Bottom="70"
AlternateText="Navigate to Reports" />
<asp:RectangleHotSpot
NavigateUrl=" Left="495"
Top="40"
Right="595"
Bottom="75"
AlternateText="Navigate to Projects" />
<asp:RectangleHotSpot
NavigateUrl=" Left="620"
Top="40"
Right="675"
Bottom="70"
AlternateText="Navigate to Home" />
</asp:ImageMap>
</span></strong></span></td>
</tr>
<tr>
<td><span class="style1">To permanently delete a project, select it from the dropdown list, then click &quot;DELETE&quot;.To add a new project to the Hotsheet, click on &quot;NEW&quot;, enter the project criteria then click &quot;INSERT&quot;. </span></td>
</tr>
<tr>
<td><form id="form1" runat="server">
<div> <span style="font-size: 22pt; color: #990000; font-family: Trebuchet MS"><strong> <span style="font-size: 11pt; color: #000000">&nbsp;&nbsp;</span></strong></span><br />
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1"
DataTextField="PROJECT" DataValueField="ID"> </asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:HOTSHEETConnectionString %>"
SelectCommand="SELECT DISTINCT * FROM [PROJECTS]"></asp:SqlDataSource>
<asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"
CellPadding="4" DataSourceID="SqlDataSource2" Font-Names="Trebuchet MS" Font-Size="Medium"
ForeColor="Black" GridLines="Vertical" Height="50px" Width="719px" Font-Bold="True">
<PagerSettings FirstPageText="First&lt;&lt;" LastPageText="Last&gt;&gt;"
Mode="NumericFirstLast" NextPageText="Next&gt;" Position="TopAndBottom" PreviousPageText="Prev&lt;" />
<FooterStyle BackColor="#CCCC99" />
<EditRowStyle BackColor="White" Font-Bold="True" ForeColor="Black" />
<RowStyle BackColor="#F7F7DE" />
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
<Fields>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="False" ShowInsertButton="True" />
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
SortExpression="ID" />
<asp:TemplateField HeaderText="PROJECT" SortExpression="PROJECT">
<EditItemTemplate>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:HOTSHEETConnectionString %>"
DeleteCommand="DELETE FROM [PROJECTS] WHERE [ID] = @ID" InsertCommand="INSERT INTO [PROJECTS] ([PROJECT], [STATUS], [NEXT_STEP], [DEL_DATE], [TASK_ORDER], [SIGNED_MARE], [ACTION_OFFICER], [TWJ_CONTACT], [PRIORITY]) VALUES (@PROJECT, @STATUS, @NEXT_STEP, @DEL_DATE, @TASK_ORDER, @SIGNED_MARE, @ACTION_OFFICER, @TWJ_CONTACT, @PRIORITY)"
SelectCommand="SELECT * FROM [PROJECTS]" UpdateCommand="UPDATE [PROJECTS] SET [PROJECT] = @PROJECT, [STATUS] = @STATUS, [NEXT_STEP] = @NEXT_STEP, [DEL_DATE] = @DEL_DATE, [TASK_ORDER] = @TASK_ORDER, [SIGNED_MARE] = @SIGNED_MARE, [ACTION_OFFICER] = @ACTION_OFFICER, [TWJ_CONTACT] = @TWJ_CONTACT, [PRIORITY] = @PRIORITY WHERE [ID] = @ID">
<DeleteParameters>
<asp:parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
<asp:parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:TextBox ID="TextBox1" TextMode="MultiLine" runat="server" Height="50px" Text='<%# Bind("PROJECT") %>'
Width="500px"></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:HOTSHEETConnectionString %>"
DeleteCommand="DELETE FROM [PROJECTS] WHERE [ID] = @ID" InsertCommand="INSERT INTO [PROJECTS] ([PROJECT], [STATUS], [NEXT_STEP], [DEL_DATE], [TASK_ORDER], [SIGNED_MARE], [ACTION_OFFICER], [TWJ_CONTACT], [PRIORITY]) VALUES (@PROJECT, @STATUS, @NEXT_STEP, @DEL_DATE, @TASK_ORDER, @SIGNED_MARE, @ACTION_OFFICER, @TWJ_CONTACT, @PRIORITY)"
SelectCommand="SELECT * FROM [PROJECTS]" UpdateCommand="UPDATE [PROJECTS] SET [PROJECT] = @PROJECT, [STATUS] = @STATUS, [NEXT_STEP] = @NEXT_STEP, [DEL_DATE] = @DEL_DATE, [TASK_ORDER] = @TASK_ORDER, [SIGNED_MARE] = @SIGNED_MARE, [ACTION_OFFICER] = @ACTION_OFFICER, [TWJ_CONTACT] = @TWJ_CONTACT, [PRIORITY] = @PRIORITY WHERE [ID] = @ID">
<DeleteParameters>
<asp:parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
<asp:parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:TextBox ID="TextBox1" TextMode="MultiLine" runat="server" Height="50px" Text='<%# Bind("PROJECT") %>'
Width="500px"></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("PROJECT") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="STATUS" SortExpression="STATUS">
<EditItemTemplate>
<asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:HOTSHEETConnectionString %>"
DeleteCommand="DELETE FROM [PROJECTS] WHERE [ID] = @ID" InsertCommand="INSERT INTO [PROJECTS] ([PROJECT], [STATUS], [NEXT_STEP], [DEL_DATE], [TASK_ORDER], [SIGNED_MARE], [ACTION_OFFICER], [TWJ_CONTACT], [PRIORITY]) VALUES (@PROJECT, @STATUS, @NEXT_STEP, @DEL_DATE, @TASK_ORDER, @SIGNED_MARE, @ACTION_OFFICER, @TWJ_CONTACT, @PRIORITY)"
SelectCommand="SELECT * FROM [PROJECTS]" UpdateCommand="UPDATE [PROJECTS] SET [PROJECT] = @PROJECT, [STATUS] = @STATUS, [NEXT_STEP] = @NEXT_STEP, [DEL_DATE] = @DEL_DATE, [TASK_ORDER] = @TASK_ORDER, [SIGNED_MARE] = @SIGNED_MARE, [ACTION_OFFICER] = @ACTION_OFFICER, [TWJ_CONTACT] = @TWJ_CONTACT, [PRIORITY] = @PRIORITY WHERE [ID] = @ID">
<DeleteParameters>
<asp:parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
<asp:parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:TextBox ID="TextBox2" TextMode="MultiLine" runat="server" Height="50px" Text='<%# Bind("STATUS") %>'
Width="500px"></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:SqlDataSource ID="SqlDataSource6" runat="server" ConnectionString="<%$ ConnectionStrings:HOTSHEETConnectionString %>"
DeleteCommand="DELETE FROM [PROJECTS] WHERE [ID] = @ID" InsertCommand="INSERT INTO [PROJECTS] ([PROJECT], [STATUS], [NEXT_STEP], [DEL_DATE], [TASK_ORDER], [SIGNED_MARE], [ACTION_OFFICER], [TWJ_CONTACT], [PRIORITY]) VALUES (@PROJECT, @STATUS, @NEXT_STEP, @DEL_DATE, @TASK_ORDER, @SIGNED_MARE, @ACTION_OFFICER, @TWJ_CONTACT, @PRIORITY)"
SelectCommand="SELECT * FROM [PROJECTS]" UpdateCommand="UPDATE [PROJECTS] SET [PROJECT] = @PROJECT, [STATUS] = @STATUS, [NEXT_STEP] = @NEXT_STEP, [DEL_DATE] = @DEL_DATE, [TASK_ORDER] = @TASK_ORDER, [SIGNED_MARE] = @SIGNED_MARE, [ACTION_OFFICER] = @ACTION_OFFICER, [TWJ_CONTACT] = @TWJ_CONTACT, [PRIORITY] = @PRIORITY WHERE [ID] = @ID">
<DeleteParameters>
<asp:parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
<asp:parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:TextBox ID="TextBox2" TextMode="MultiLine" runat="server" Height="50px" Text='<%# Bind("STATUS") %>'
Width="500px"></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("STATUS") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="NEXT STEP" SortExpression="NEXT_STEP">
<EditItemTemplate>
<asp:SqlDataSource ID="SqlDataSource7" runat="server" ConnectionString="<%$ ConnectionStrings:HOTSHEETConnectionString %>"
DeleteCommand="DELETE FROM [PROJECTS] WHERE [ID] = @ID" InsertCommand="INSERT INTO [PROJECTS] ([PROJECT], [STATUS], [NEXT_STEP], [DEL_DATE], [TASK_ORDER], [SIGNED_MARE], [ACTION_OFFICER], [TWJ_CONTACT], [PRIORITY]) VALUES (@PROJECT, @STATUS, @NEXT_STEP, @DEL_DATE, @TASK_ORDER, @SIGNED_MARE, @ACTION_OFFICER, @TWJ_CONTACT, @PRIORITY)"
SelectCommand="SELECT * FROM [PROJECTS]" UpdateCommand="UPDATE [PROJECTS] SET [PROJECT] = @PROJECT, [STATUS] = @STATUS, [NEXT_STEP] = @NEXT_STEP, [DEL_DATE] = @DEL_DATE, [TASK_ORDER] = @TASK_ORDER, [SIGNED_MARE] = @SIGNED_MARE, [ACTION_OFFICER] = @ACTION_OFFICER, [TWJ_CONTACT] = @TWJ_CONTACT, [PRIORITY] = @PRIORITY WHERE [ID] = @ID">
<DeleteParameters>
<asp:parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
<asp:parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:TextBox ID="TextBox3" TextMode="MultiLine" runat="server" Height="50px" Text='<%# Bind("NEXT_STEP") %>'
Width="500px"></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:SqlDataSource ID="SqlDataSource10" runat="server" ConnectionString="<%$ ConnectionStrings:HOTSHEETConnectionString %>"
DeleteCommand="DELETE FROM [PROJECTS] WHERE [ID] = @ID" InsertCommand="INSERT INTO [PROJECTS] ([PROJECT], [STATUS], [NEXT_STEP], [DEL_DATE], [TASK_ORDER], [SIGNED_MARE], [ACTION_OFFICER], [TWJ_CONTACT], [PRIORITY]) VALUES (@PROJECT, @STATUS, @NEXT_STEP, @DEL_DATE, @TASK_ORDER, @SIGNED_MARE, @ACTION_OFFICER, @TWJ_CONTACT, @PRIORITY)"
SelectCommand="SELECT * FROM [PROJECTS]" UpdateCommand="UPDATE [PROJECTS] SET [PROJECT] = @PROJECT, [STATUS] = @STATUS, [NEXT_STEP] = @NEXT_STEP, [DEL_DATE] = @DEL_DATE, [TASK_ORDER] = @TASK_ORDER, [SIGNED_MARE] = @SIGNED_MARE, [ACTION_OFFICER] = @ACTION_OFFICER, [TWJ_CONTACT] = @TWJ_CONTACT, [PRIORITY] = @PRIORITY WHERE [ID] = @ID">
<DeleteParameters>
<asp:parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
<asp:parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:TextBox ID="TextBox3" TextMode="MultiLine" runat="server" Text='<%# Bind("NEXT_STEP") %>' Height="50px" Width="500px"></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("NEXT_STEP") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="DEL_DATE" HeaderText="DELIVERY DATE" SortExpression="DEL_DATE" />
<asp:BoundField DataField="TASK_ORDER" HeaderText="TASK ORDER" SortExpression="TASK_ORDER" />
<asp:BoundField DataField="SIGNED_MARE" HeaderText="SIGNED MARE" SortExpression="SIGNED_MARE" />
<asp:BoundField DataField="ACTION_OFFICER" HeaderText="ACTION OFFICER" SortExpression="ACTION_OFFICER" />
<asp:BoundField DataField="TWJ_CONTACT" HeaderText="TWJ CONTACT" SortExpression="TWJ_CONTACT" />
<asp:TemplateField HeaderText="PRIORITY" SortExpression="PRIORITY">
<EditItemTemplate>
<asp:SqlDataSource ID="SqlDataSource8" runat="server" ConnectionString="<%$ ConnectionStrings:HOTSHEETConnectionString2 %>"
SelectCommand="SELECT DISTINCT [PRIORITY] FROM [PROJECTS]"></asp:SqlDataSource>
<asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource8"
DataTextField="PRIORITY" DataValueField="PRIORITY" SelectedValue='<%# Bind("PRIORITY") %>'> </asp:DropDownList>
</EditItemTemplate>
<InsertItemTemplate>
<asp:SqlDataSource ID="SqlDataSource9" runat="server" ConnectionString="<%$ ConnectionStrings:HOTSHEETConnectionString %>"
SelectCommand="SELECT DISTINCT [PRIORITY] FROM [PROJECTS]"></asp:SqlDataSource>
<asp:DropDownList ID="DropDownList3" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource9"
DataTextField="PRIORITY" DataValueField="PRIORITY" SelectedValue='<%# Bind("PRIORITY") %>'> </asp:DropDownList>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("PRIORITY") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Fields>
<FieldHeaderStyle Width="175px" Font-Size="Small" ForeColor="Gray" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" Width="150px" />
<AlternatingRowStyle BackColor="White" />
<CommandRowStyle Font-Bold="True" ForeColor="Maroon" HorizontalAlign="Center" VerticalAlign="Top"
Wrap="False" />
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:HOTSHEETConnectionString2 %>"
DeleteCommand="DELETE FROM [PROJECTS] WHERE [ID] = @ID" InsertCommand="INSERT INTO [PROJECTS] ([PROJECT], [STATUS], [NEXT_STEP], [DEL_DATE], [TASK_ORDER], [SIGNED_MARE], [ACTION_OFFICER], [TWJ_CONTACT], [PRIORITY]) VALUES (@PROJECT, @STATUS, @NEXT_STEP, @DEL_DATE, @TASK_ORDER, @SIGNED_MARE, @ACTION_OFFICER, @TWJ_CONTACT, @PRIORITY)"
SelectCommand="SELECT * FROM [PROJECTS] WHERE ([ID] = @ID)" UpdateCommand="UPDATE [PROJECTS] SET [PROJECT] = @PROJECT, [STATUS] = @STATUS, [NEXT_STEP] = @NEXT_STEP, [DEL_DATE] = @DEL_DATE, [TASK_ORDER] = @TASK_ORDER, [SIGNED_MARE] = @SIGNED_MARE, [ACTION_OFFICER] = @ACTION_OFFICER, [TWJ_CONTACT] = @TWJ_CONTACT, [PRIORITY] = @PRIORITY WHERE [ID] = @ID">
<DeleteParameters>
<asp:parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
<asp:parameter Name="ID" Type="Int32" />
</UpdateParameters>
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" DefaultValue="1" Name="ID" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
<InsertParameters>
<asp:parameter Name="PROJECT" Type="String" />
<asp:parameter Name="STATUS" Type="String" />
<asp:parameter Name="NEXT_STEP" Type="String" />
<asp:parameter Name="DEL_DATE" Type="String" />
<asp:parameter Name="TASK_ORDER" Type="String" />
<asp:parameter Name="SIGNED_MARE" Type="String" />
<asp:parameter Name="ACTION_OFFICER" Type="String" />
<asp:parameter Name="TWJ_CONTACT" Type="String" />
<asp:parameter Name="PRIORITY" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</div>
</form></td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>
 
Must declare the scalar variable "@ID".
I don't see anywhere where you have done this


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Hi and thanks for the reply, I am very new to this ASP.net and SQL stuff so please excuse some of my terminology and explanations. Someone created this and now has left without ever getting this to work. I'm not quite following your previous response?
 
Well, the error message says that you must declare a variable named @ID and you haven't (as far as I can see). That's why you get the error message.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Okay makes a little more sense. Where would I declare the variable @ID if you don't mind me asking? I've only been doing this for a couple of days and have come to like it very much. Somethings makes total sense some is very confusing.
 
You will have to modify the sqldatasource. In there you will have to add the parameter @ID.

Jim
 
Thanks for the reply. I'll dive back into it and see if I can figure out how to modify the sqldatasource to add the parameter @ID. Either way I'll let you all know what the fix and outcome is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top