c# - Spring.net SQL select a single value -
hey, there way using spring.net run select query , have return single value. if there way, how go doing it?
as far know spring .net manipulates data using both nhibernate , it's own dao.
sooo... if you're using spring .net dao should use
executescalar method of dbcommand.
if you're looking nhibernate example, should use
uniqueresult method of iquery
it should this:
long veryimportantid = (long) session.getnamedquery("somequeryname").setstring("someparam", "somevalue").uniqueresult();
i hope helps you. if not, please write more details issue.
Comments
Post a Comment