Проблема с параметрами
Пишу запрос:
SELECT * FROM patient INNER JOIN oprs ON patient.uid = oprs.uid
INNER JOIN n_otd ON oprs.otd = n_otd.otd
INNER JOIN n_opr ON oprs.opr = n_opr.opr
INNER JOIN N_MPS ON oprs.doc = n_mps.kmp
INNER JOIN NP_ANS ON oprs.ans = np_ans.ans
WHERE n_otd.notd = @Parameter
AND ( oprs.dvo BETWEEN '@Parameter1' AND '@Parameter2' )
Ошибка:
System.Reflection.TargetInvocationException: ÀäðåñГ*ГІ âûçîâГ* ñîçäГ*Г« èñêëþ÷åГ*ГЁГҐ. ---> FirebirdSql.Data.FirebirdClient.FbException: conversion error from string "@Parameter1" ---> FirebirdSql.Data.Common.IscException: conversion error from string "@Parameter1"
Гў FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ProcessResponse(IResponse response) Гў C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\Version10\GdsDatabase.cs:ñòðîêГ* 639
Гў FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadResponse() Гў C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\Version10\GdsDatabase.cs:ñòðîêГ* 671
Гў FirebirdSql.Data.Client.Managed.Version10.GdsStatement.Fetch() Гў C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\Version10\GdsStatement.cs:ñòðîêГ* 397
Гў FirebirdSql.Data.FirebirdClient.FbCommand.Fetch() Гў C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbCommand.cs:ñòðîêГ* 662
--- ГЉГ®Г*ГҐГ¶ ГІГ°Г*ññèðîâêè ГўГ*óòðåГ*Г*ГҐГЈГ® Г±ГІГҐГЄГ* èñêëþ÷åГ*ГЁГ© ---
Гў FirebirdSql.Data.FirebirdClient.FbCommand.Fetch() Гў C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbCommand.cs:ñòðîêГ* 667
Гў FirebirdSql.Data.FirebirdClient.FbDataReader.Read() Гў C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbDataReader.cs:ñòðîêГ* 244
Гў System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
Гў System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
Гў System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
Гў System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
Гў System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
Гў System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
Гў FastReport.Data.DataConnectionBase.FillTableData(DataTable table, String selectCommand, CommandParameterCollection parameters)
Гў FastReport.Data.DataConnectionBase.FillTable(TableDataSource source)
Гў FastReport.Data.TableDataSource.LoadData(ArrayList rows)
Гў FastReport.Data.DataSourceBase.Init(Relation relation, String filter, SortCollection sort, Boolean useAllParentRows)
Гў FastReport.Data.DataSourceBase.Init()
Гў FastReport.ReportScript.Table1_ManualBuild(Object sender, EventArgs e)
--- ГЉГ®Г*ГҐГ¶ ГІГ°Г*ññèðîâêè ГўГ*óòðåГ*Г*ГҐГЈГ® Г±ГІГҐГЄГ* èñêëþ÷åГ*ГЁГ© ---
Гў System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
Гў System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
Гў System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Гў System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
Гў FastReport.Code.ExpressionDescriptor.Invoke(Object[] parameters)
Гў FastReport.Code.AssemblyDescriptor.InvokeEvent(String name, Object[] parms)
Гў FastReport.Report.InvokeEvent(String name, Object[] parms)
Гў FastReport.Base.InvokeEvent(String name, Object param)
Гў FastReport.Table.TableObject.OnManualBuild(EventArgs e)
Гў FastReport.Table.TableObject.SaveState()
Гў FastReport.BandBase.SaveState()
Гў FastReport.Engine.ReportEngine.ShowBandToPreparedPages(BandBase band, Boolean getData)
Гў FastReport.Engine.ReportEngine.ShowBand(BandBase band, Boolean getData)
Гў FastReport.Engine.ReportEngine.ShowDataBand(DataBand dataBand, Int32 rowCount)
Гў FastReport.Engine.ReportEngine.RunDataBand(DataBand dataBand, Int32 rowCount, Boolean keepFirstRow, Boolean keepLastRow)
Гў FastReport.Engine.ReportEngine.RunDataBand(DataBand dataBand)
Гў FastReport.Engine.ReportEngine.RunBands(BandCollection bands)
Гў FastReport.Engine.ReportEngine.RunReportPage(ReportPage page)
Гў FastReport.Engine.ReportEngine.RunReportPages()
Гў FastReport.Engine.ReportEngine.RunReportPages(ReportPage page)
Гў FastReport.Engine.ReportEngine.Run(Boolean runDialogs, Boolean append, Boolean resetDataState, ReportPage page)
Гў FastReport.Report.Prepare(Boolean append)
Гў FastReport.Report.Prepare()
Гў FastReport.Design.ReportTab.Preview()
Если в запрос делаю без параметров для between то запрос проходит норм:
SELECT * FROM patient INNER JOIN oprs ON patient.uid = oprs.uid
INNER JOIN n_otd ON oprs.otd = n_otd.otd
INNER JOIN n_opr ON oprs.opr = n_opr.opr
INNER JOIN N_MPS ON oprs.doc = n_mps.kmp
INNER JOIN NP_ANS ON oprs.ans = np_ans.ans
WHERE n_otd.notd = @Parameter
AND ( oprs.dvo BETWEEN '01.09.2016' AND '30.09.2016' )
Комментарии