Failed to convert parameter

I received this error message when i try to use dataselector to pass parameter to sql function... >[img]style_emoticons/<#EMO_DIR#>/ph34r.gif" style="vertical-align:middle" emoid=":ph34r:" border="0" alt="ph34r.gif" /> FastReport.Net v1.3.25 Failed to convert parameter value from a String[] to a String. Inner exception: Object must implement IConvertible. at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType) at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType) at System.Data.SqlClient.SqlParameter.GetCoercedValue() at System.Data.SqlClient.SqlParameter.Validate(Int32 index, Boolean isCommandProc) at System.Data.SqlClient.SqlCommand.BuildParamList(TdsParser parser, SqlParameterCollection parameters) at System.Data.SqlClient.SqlCommand.BuildExecuteSql(CommandBehavior behavior, String commandText, SqlParameterCollection parameters, _SqlRPC& rpc) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at FastReport.Data.DataConnectionBase.FillTableData(DataTable table, String selectCommand, CommandParameterCollection parameters) at FastReport.Data.DataConnectionBase.FillTable(TableDataSource source) at FastReport.Data.TableDataSource.LoadData(ArrayList rows) at FastReport.Data.DataSourceBase.xhRusQrvC() at FastReport.Data.DataSourceBase.Init(Relation relation, String filter, SortCollection sort) at FastReport.Data.DataSourceBase.Init(DataSourceBase parentData, String filter, SortCollection sort) at FastReport.DataBand.InitDataSource() at FastReport.GroupHeaderBand.JpXNscdbD() at FastReport.Engine.ReportEngine.O9MBQ6Cab(GroupHeaderBand ) at FastReport.Engine.ReportEngine.cYGNCD6VBn(BandCollection ) at FastReport.Engine.ReportEngine.0o7NSxJGS3(ReportPage ) at FastReport.Engine.ReportEngine.i73Nip9s4d() at FastReport.Engine.ReportEngine.ETbCChjds(ReportPage ) at FastReport.Engine.ReportEngine.j5trlWRx0(Boolean , Boolean , ReportPage ) at FastReport.Engine.ReportEngine.gqwMraMKx(Boolean , Boolean ) at FastReport.Report.Prepare(Boolean append) at FastReport.Report.Prepare() at plVQu6DlA1kWEugkKuY.9n4jBkD1hZrXBD9AwUv.T5oiHycTE()[/img]

Comments

  • edited 1:44AM
    Sql parameter can take single value only. You are trying to pass an array of string values, this is not correct.
  • edited 1:44AM
    AlexTZ wrote: »
    Sql parameter can take single value only. You are trying to pass an array of string values, this is not correct.

    It is posible if i want to make the array string convert to a string separate by "," , isn't it?
    Cuz i a newbie...thx for ur patient
  • edited 1:44AM
    This conversion can be done using own function. You can declare it in the report script.
    Are you trying to pass values to sql "IN" operator (select * from table where field IN (@param1))? It will not work. You have to change the sql text before execution, instead of using a parameter.
  • edited 1:44AM
    AlexTZ wrote: »
    This conversion can be done using own function. You can declare it in the report script.
    Are you trying to pass values to sql "IN" operator (select * from table where field IN (@param1))? It will not work. You have to change the sql text before execution, instead of using a parameter.

    thx ~ problem solve~

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.