Hi all.
The following query
displays the information I need in the gridview for a single record.
SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM, OE_HDR.SLS_MAN_NO,
OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT, OE_HDR.****P_DAT
FROM OE_HDR WHERE (OE_HDR.ORD_NO='174310')
I also have DropDownList2 working properly. For the WHERE ****tion of
the query I would like to pass a variable that references the value
of
DropDownList2
SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM, OE_HDR.SLS_MAN_NO,
OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT, OE_HDR.****P_DAT
FROM OE_HDR WHERE (OE_HDR.ORD_NO= @[EMAIL PROTECTED]
)
Here is the code that is erroring out:
<asp:SqlDataSource runat="server" ID="SqlDataSource2"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
SelectCommand="SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM,
OE_HDR.SLS_MAN_NO, OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT,
OE_HDR.****P_DAT FROM OE_HDR WHERE OE_HDR.ORD_NO= @[EMAIL PROTECTED]
">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2" Name="ORD_NO"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
Here is the error I get on the webpage:
ERROR [42000] [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC
Engine Interface]Syntax Error: SELECT OE_HDR.ORD_NO, OE_HDR.CUST_NAM,
OE_HDR.SLS_MAN_NO, OE_HDR.SLS_MAN_INITIALS, OE_HDR.ORD_DAT,
OE_HDR.****P_DAT FROM OE_HDR WHERE OE_HDR.ORD_NO= @[EMAIL PROTECTED]
??? >>ORD_NO
Seems like the syntax for the variable in the WHERE ****tion of my
query is wrong. Any suggestions/help would be much appreciated.
Thank you!


|