Hi
i want to make a distinct request on a table :
Code:
public IList GetAllNames()
{
string sql = "SELECT DISTINCT(Name) FROM myTable;";
ISQLQuery sqlQuery = this.Session.CreateSQLQuery(sql);
sqlQuery.AddScalar("Name", NHibernateUtil.String);
IList listOfNames = sqlQuery.List();
return listOfNames;
}
The return list have the correct number of record but all of the entries are null !
I have test with :
Code:
public IList GetAllNames()
{
string sql = "SELECT Name FROM myTable;";
ISQLQuery sqlQuery = this.Session.CreateSQLQuery(sql);
sqlQuery.AddScalar("Name", NHibernateUtil.String);
IList listOfNames = sqlQuery.List();
return listOfNames;
}
and it works !
thx for your help