views:

99

answers:

1

Hi, I'm new to NHibernate. Actually I'm trying to save the values ffrom two text boxes into MySql Database in asp.Net page. I that I got "Resource not found: WebApplication1.Sample.hbm.xml" error. But I can't fix this error. Can anyone help me to fix this one?

+2  A: 

That sounds like the error you get if you do not set your hbm's Build Action to Embedded Resource.

Step by step for build action

EDIT References to set to Copy Local = True

  • Castle.Core
  • Castle.DynamicProxy2
  • Iesi.Collections
  • NHibernate
  • NHibernate.ByteCode.Castle
cmsjr
Ya, tat problem fixed. But one more error arised tat "Object reference not set to an instance of an object." It shows in Textbox.
Siva
That is probably being caused because you have one or more libraries that NHibernate references set to Copy Local = true. I'll post a list of what's working for me in a moment.
cmsjr
Ya, I set NHibernate reference set to copy local= true. But still the same error
Siva
It doesn't need to just be the Nhibernate reference, you need either all of the above referenced and set to copy local, or if not referenced, then in a directory your app can find. If that still doesn't do the trick your going to need to dig deeper into the exception details. There's probably an Inner exception with more detail.
cmsjr
Now got another error tat "Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index" Its showing in textbox field
Siva
Off the top of my head I'd say your trying to iterate over a collection with no members, or access one that doesn't exist. Can you post the code in question?
cmsjr
Ya thanks cmsjr, I got tat.Actually I was trying to access the data which doesn't exit.. Nw got cleared
Siva