On May 5, 7:09 am, (e-mail address removed) wrote:
<asp:SqlDataSource
...
WHERE OE_HDR.ORD_NO = @DropDownList1
">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="DropDownList1"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>- Hide quoted text -
Thanks for the reply.
Here is the code that works and displays one record based on the
definitive ...WHERE OE_HDR.ORD_NO= '140173'">
<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.SHIP_DAT FROM OE_HDR WHERE OE_HDR.ORD_NO= '140173'">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2"
Name="DropDownList2"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
When I change the code to use the variable:
<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.SHIP_DAT FROM OE_HDR WHERE OE_HDR.ORD_NO= @DropDownList2">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList2"
Name="DropDownList2"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
I get this error in my page:
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.SHIP_DAT FROM OE_HDR WHERE OE_HDR.ORD_NO=@<< ???>>DropDownList2
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.Odbc.OdbcException: 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.SHIP_DAT FROM OE_HDR WHERE OE_HDR.ORD_NO=@<< ???
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:
[OdbcException (0x80131937): 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.SHIP_DAT FROM OE_HDR
WHERE OE_HDR.ORD_NO=@<< ??? >>DropDownList2]
System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle,
RetCode retcode) +35
System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior
behavior, String method, Boolean needReader, Object[] methodArguments,
SQL_API odbcApiMethod) +1735
System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior
behavior, String method, Boolean needReader) +60
System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior
behavior) +75
System.Data.Odbc.OdbcCommand.ExecuteDbDataReader(CommandBehavior
behavior) +4
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior
behavior) +7
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior) +141
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable) +83
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments
arguments) +1770
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments
arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
+82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
+69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1360
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42
Any Ideas?
Thanks again for you help.- Hide quoted text -
- Show quoted text -