473,587 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wondering if someone can help me with NHibernate

57 New Member
Hi I'm looking for help with getting the latest NHibernate to work with my .Net 3.5 VS 2008 project that I am migrating from .Net 2.0 on VS 2005. Previously (VS 2005 .Net 2.0) I would use the folling lines to query the database:

Expand|Select|Wrap|Line Numbers
  1. ICriteria criteria = mSession.CreateCriteria(typeof(Application));
  2. criteria.Add(new EqExpression("ReferenceNumber", "2008/0128/NEW", true));
  3. BCApplication application = (Application)criteria.UniqueResult();
This does not work in .Net 3.5 as I cannot seem to find EqExpression. In .Net 2.0 version of Nhibernate it is contained within NHibernate.Expr ession.EqExpres sion however .Net 3.5 version of NHibernate does not have the Expression class.

I'm having a nightmare googling this, so can someone please help me!!
Jul 28 '09 #1
1 2246
moorcroft
57 New Member
OK forget about this actually I've worked out that it should now be:

Expand|Select|Wrap|Line Numbers
  1. criteria.Add(Restrictions.Eq("ApplicationNumber", referenceNumber));
Jul 29 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
1665
by: anna | last post by:
Map, generate, and maintain 50% of your .NET application code, namely your business and data objects. Use these objects in ASP.NET, Windows Forms, console or services applications. Business and Data Objects Framework -- Map objects to relational databases -- Embed SQL, stored procedure calls, and business rules -- Generate .NET components...
0
3313
by: Pierre | last post by:
Hi, In my C# project (VisitorManagement) I have a subfolder (BusinessObjects) in which I have put the objects needed for NHibernate and the mapping files. In the top of my web service I do a using VisitorManagement.BusinessObjects; and I'm able to use these objects. But When I invoke the web service I get the following error.
8
8459
by: Roman | last post by:
Hello i got this simple problem using nhibernate. I want to chang the id( primary key of the) object and update it, to change this key. i me getting nhibernate exception like this: identifier of an instance of {0} altered from {1} ({2}) to {3} ({4}) // in place of number, there are values and their types. can anyone help me?
1
13698
by: erin.sebastian | last post by:
Hello All, I am new to hibernate and new to nHibernate. I created a small app and when i try and run it i get the error i posted at the bottom of this message. I am using the helper class that can be found here http://blogs.intesoft.net/simon/articles/16.aspx#36 . Does anyone know why this error might occur.. i have NO IDEA.... if you...
1
2556
by: Ram | last post by:
Hey, I'm having a trouble mapping a connecting between 2 of my tables. We have 2 tables - the simplest "dept", "emp" tables which are mapped to 2 classes. Class Dept contains 2 properties for emps - 1 for manager and the second for workers (Collection). How can I map this? We can add additional fields in the emp table that indicates the...
1
12726
by: sternr | last post by:
Hey, I'm using NHibernate version: 1.0.0.2 My Mapping documents: <class name="DM.Book" table="Books"> <id column="bookId" name="bookId"> <generator class="assigned" /> </id> <property column="name" name="name" />
5
9565
by: gaddoz | last post by:
Hi all, I'm trying to set up a .NET webservice using in data access layer Nhibernate (nhib 1.2.0 beta). The first trouble I met was that a webservice cannot serialize Interfaces, like IList<>. After I workarounded it, now I get: System.InvalidOperationException: There was an error generating the XML
4
3329
by: IceMan | last post by:
Hi, I am using the configuration object and passing it a Assembly object to load. The assembly object i pass in is from a dll which is in a different folder then the Nhibernate dll. The AddAssembly(Assembly assembly) function throws me an Error saying it can't load the configuration hbm.xml file because it can't load the assembly in the...
0
1016
by: mukeshhaval | last post by:
Dear Sir We are using NHibernate with Asp.net. I have written this code in HBM file <sql-query name="OtherProfileAreas"> <return class="OtherProfileArea"> <return-property name="OtherDomain" column="OtherDomain"/> <return-property name="Total" column="Total"/> </return> exec .
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.