.net entity framework 使用 LINQ 技術
using (MIDSModel.MIDSEntities md = new MIDSModel.MIDSEntities())
{
string query = (from c in md.WT_MIDS_OTH_DOC_TYPE
where 1 == 1 && c.TYPE_ID == id1
select c.TYPE_NAME).FirstOrDefault()
;
((Label)e.Row.FindControl("tNameL1")).Text = query;
}
Java JPA
@PersistenceContext
private EntityManager em;
List list1 = em.createQuery("select object(o) from WtSalNotify as o WHERE o.status = 'I' ORDER BY o.notifyId ").getResultList();
沒有留言:
張貼留言