я использую cloture.xsd. я подключаю это к своему отчету Cloture_Tete.
в SQL это работает:
SELECT NO_ORDRE, CODE_CLIENT, CODE_DEST, STATUT_ORDRE, RS_NOM, ADRESSE, CP, VILLE, PAYS, INSEE, SIRET, TEL, FAX, EMAIL, ENLEV_UNITE, ENLEV_CREMB,
ENLEV_DECL, MODAL_MODE, MODAL_PORT, MODAL_SPEC, LIVRS_EXPRS, LIVRS_SIGN, LIVRS_SAMD, NBR_COLIS, POID, POID_COR, CODE_MAG, OBS,
DATE_CREE, DATE_MODIF, CREE_PAR, MODIF_PAR, REF_EXPED, AUTRE_REF, DATE_CLOTUR, AGENCE, TRANSPORTEUR, CHAUFFEUR, FACTURATION
FROM ORDRE
WHERE (STATUT_ORDRE = 2) AND (TRANSPORTEUR IN (1, 2))
но когда я делаю через C #:
protected void Page_Load(object sender, EventArgs e)
{
string CHAUFFEUR = Request.QueryString["CHAUFFEUR"];
string CODE_CLIENT = Request.QueryString["ClientID"];
string ClotList = Request.QueryString["ClotList"];
try
{
using (var connectionWrapper = new Connexion())
{
ReportViewer_Cloture.Report = new Cloture_Tete(Convert.ToInt32(CHAUFFEUR), CODE_CLIENT, ClotList);
}
}
catch (Exception excThrown)
{
throw new Exception(excThrown.Message);
}
}
с моим предопределенным Выбрать в cloture.xsd:
SELECT ADRESSE, AGENCE, AUTRE_REF, CHAUFFEUR, CODE_CLIENT, CODE_DEST, CODE_MAG, CP, CREE_PAR, DATE_CLOTUR, DATE_CREE, DATE_MODIF, EMAIL, ENLEV_CREMB, ENLEV_DECL, ENLEV_UNITE, FACTURATION, FAX, INSEE, LIVRS_EXPRS, LIVRS_SAMD, LIVRS_SIGN, MODAL_MODE, MODAL_PORT, MODAL_SPEC, MODIF_PAR, NBR_COLIS, NO_ORDRE, OBS, PAYS, POID, POID_COR, REF_EXPED, RS_NOM, SIRET, STATUT_ORDRE, TEL, TRANSPORTEUR, VILLE FROM ORDRE WHERE (STATUT_ORDRE = 2) AND (TRANSPORTEUR IN (@Trans))
и я смотрю с помощью своего SQL Profiler:
exec sp_executesql N'SELECT ADRESSE, AGENCE, AUTRE_REF, CHAUFFEUR, CODE_CLIENT, CODE_DEST, CODE_MAG, CP, CREE_PAR, DATE_CLOTUR, DATE_CREE, DATE_MODIF, EMAIL, ENLEV_CREMB, ENLEV_DECL, ENLEV_UNITE, FACTURATION, FAX, INSEE, LIVRS_EXPRS, LIVRS_SAMD, LIVRS_SIGN, MODAL_MODE, MODAL_PORT, MODAL_SPEC, MODIF_PAR, NBR_COLIS, NO_ORDRE, OBS, PAYS, POID, POID_COR, REF_EXPED, RS_NOM, SIRET, STATUT_ORDRE, TEL, TRANSPORTEUR, VILLE FROM ORDRE WHERE (STATUT_ORDRE = 2) AND (TRANSPORTEUR IN (@Trans))',N'@Trans varchar(50)',@Trans='1,2'
это не работает, почему разные просто (TRANSPORTEUR IN (1, 2))
в SQL и (TRANSPORTEUR IN (@Trans))',N'@Trans varchar(50)',@Trans='1,2'
спасибо заранее