Hi,

I have below C# ASP.NET code to get distinct row of Coulmn batc
id.

config = new NHibernate.Cfg.Configuration();
        config.AddAssembly(typeof(CSTS.Main.CashPosting).Assembly);
        factory = config.BuildSessionFactory();
        session = factory.OpenSession();
        query = session.CreateQuery("FROM CashPosting");
        IList<CSTS.Main.CashPosting> Trans =
query.List<CSTS.Main.CashPosting>();
        ICriteria criteria = session.CreateCriteria(typeof
(CashPosting));
        criteria.SetProjection(Projections.Distinct
(Projections.ProjectionList()
            .Add(Projections.Alias(Projections.Property("Batch_Id"),
"Batch_Id"))));
        criteria.SetResultTransformer(new
NHibernate.Transform.AliasToBeanResultTransformer(typeof
(CashPosting)));
        IList batchidList = criteria.List();
        ddBatch_id.DataSource = batchidList;
ddBatch_id.DataBind();

But I am not getting the value, it gives complete row,  i need only
batch id.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to