Bonjour a tous,
Il est possible en sql de faire "Select * From Categories where CategorieId in ( 1, 2 )".
J'aimerais savoir s'il est possible de faire ce qui suit
string ListCategorieId = "1, 2";
sqlStatement = @"Select * From Categories
where CategorieId in ( @CategorieId )";
SqlDbCommand command = "GetSqlConnection()".CreateCommand();
// ( GetSqlConnection cette fonction retourne une connection Sqlconnection )
command.CommandText = sqlStatement;
SqlDbDataParameter CategorieId = command.CreateParameter();
command.Parameters.Add( CategorieId );
CategorieId.ParameterName = "@CategorieId";
CategorieId.DbType = ?
CategorieId.Value = ListCategorieId
En fait, j'aimerais connaître qu'elle est le DBType du SqlDbDataParameter que je dois mettre pour qu'il soit pris comme "liste" d'entier?
Merci d'avance
Cordialement
Sébastien