Hello ,
I'm new to NHibernate and I'm having a very upsseting problem : I can't seem to get it to work :(. I'm using Visual Studio 2008 SP1 and Microsoft SQL SERVER 2008. I have a local data base called : Test and a table Products which looks like this : Id - type int , primary key , identity Name - type nvarchar(50) Price - type int Description - type nvarchar(50)
My project is a ASP.NET Web Site.
And just want to connect to my database and do a simple select on the Products table so that I can see that it works. Can anyone please help me. Give me a clear walkthrough of all the steps that a have to take to achive this ? Which .dll-s I have to include in my project, what line of code do I have to add in my web.config file, how should mai Products.hbm.xml file look ( I've tried working with examples I found on the net .. but it doesnt want to work for me :( ) My Products.cs file looks like this :
using System; using System.Reflection; using NHibernate; using NHibernate.Cfg;
namespace TestNameSpace { public class Products { private int id; private int categoryId; private string name; private int price; private string description;
public int Id { get { return id; } set { id = value; } }
public int CategoryId { get { return categoryId; } set { categoryId = value; } }
public string Name { get { return name; } set { name = value; } }
public int Price { get { return price; } set { price = value; } }
public string Description { get { return description; } set { description = value; } } } }
Please help me, I've wasted a hole day with this and it's getting very frustraiting. Thanks :)
|