Hi everybody!
We are getting in trouble with the native sql queries. We need to load data from a not mapped table into an object of a mapped class.
Something like:
table ZipData (zip string , city string )
into an object of:
class Address {
string zipcode;
string city;
}
we are trying this code:
String sql ="select zc.city as addr.City, zc.code as addr.ZipCode, " +
"from ZipCodes zc where addr.code = :zipCode";
session.CreateSQLQuery(sql, "addr", typeof(Address))
.SetString("zipCode", zipCode)
.List();
but it throws a nasty Exception: incorrect sintax near "."
Any suggestions will be very welcome ;-)
thks!
jv
|