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

c++ - How to modify context menu of internet explorer using IDocHostUIHandler::ShowContextMenu? -

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

c# - Getting "Internal .Net Framework Data Provider error 30" error when column has NULL value -