i have these classes http://pastebin.com/UCNJY45s

I'm trying to run this

using Castle.ActiveRecord;
using Maplestory.Stats.data;

namespace Maplestory.Stats
{
        class Program
        {
                static void Main(string[] args)
                {
                        ActiveRecordStarter.Initialize();
                        Charater charater = new Charater();
                        charater.IsMain = true;
                        charater.Job = Job.Warrior;
                        charater.Level = 17;

                        User user = User.findByName("subnus");
                        user.Charaters.Add(charater);
                        user.SaveAndFlush();
                }
        }
}

but i get the error
 "Could not perform Save for User"

and the inner exception is
"{"object references an unsaved transient instance - save the
transient instance before flushing. Type:
Maplestory.Stats.data.Charater, Entity:
Maplestory.Stats.data.Charater#0"}"

but if i save the charater before adding it to charaters list i get
the error
"Could not perform Save for Charater"

and the inner exception
"{"Parameter index is out of range."}"
source: "MySql.Data"

I'm new to Castle.ActiveRecord but i can't see what the problem is

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to