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. 

more details.

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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -