public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { SharpQuerySchemaClassCollection tmp= value as SharpQuerySchemaClassCollection; if (destinationType == typeof (ParameterCollection)) { ParameterCollection a = new ParameterCollection(); foreach (SharpQueryParameter par in tmp){ SqlParameter reportPar = new SqlParameter (par.Name, par.DataType, String.Empty, par.Type); reportPar.ParameterValue = par.Value.ToString(); a.Add(reportPar); } return a; } return base.ConvertTo(context, culture, value, destinationType); }
SqlParameterCollection CreateSqlParameters(IProcedure procedure) { SqlParameterCollection col = new SqlParameterCollection(); SqlParameter par = null; foreach (var element in procedure.Items) { DbType dbType = TypeHelpers.DbTypeFromStringRepresenation(element.DataType); par = new SqlParameter(element.Name,dbType,"",ParameterDirection.Input); if (element.ParameterMode == ParameterMode.In) { par.ParameterDirection = ParameterDirection.Input; } else if (element.ParameterMode == ParameterMode. InOut){ par.ParameterDirection = ParameterDirection.InputOutput; } col.Add(par); } return col; }
private static void SetSqlParam (IReportModel model,SqlParameter param) { var p = model.ReportSettings.SqlParameters.Find(param.ParameterName); if (p != null) { p.ParameterValue = param.ParameterValue; } }
private static void SetSqlParam (IReportModel model,SqlParameter param) { Console.WriteLine("ReportEngine:SetSqlparameters"); var p = model.ReportSettings.SqlParameters.Find(param.ParameterName); if (p != null) { p.ParameterValue = param.ParameterValue; } }