Hello,
I'm trying out the very first sample program in VS.Net 2005 from you help .chm file. I get the program to create the "Person" table for me, via this code:
//Create a database connection
SqlContext context = new SqlContext();
context.Server = "TRY-20-3228";
context.Database = "Objecto";
context.Prefix = "Crainiate.Data.Persistence.Examples";
context.UserId = "ObjectoUser";
context.Password = "test";
//Deploy changes to the database
SqlDeployment deployment = new SqlDeployment();
deployment.Context = context;
deployment.DeploymentType = Crainiate.Data.Persistence.Providers.DeploymentType.Deploy;
deployment.Deploy(System.Reflection.Assembly.GetAssembly(typeof(Crainiate.Data.Persistence.Examples.Person)));
However, when the code runs to insert a Person, just copy and pasted from your help file, it gives me the error:
The requested database was not found. Use the SqlDeployment class to create a
database if required.
The code that causes this is the following:
//Create a command to execute object data requests
Command command = context.CreateCommand();
//Insert a new person object
Person person = new Person();
person.FirstNames = "John";
person.LastNames = "Smith";
person.DateOfBirth = new DateTime(1974, 4, 23);
person.Command = command;
person.Insert();
It fails at the person.Insert() method. I've gone over this many times and I have no idea what's going on. It creates the Person table, but then can't find the database?
Thanks for any help you can provide. Our company is trying to decide on an ORM package to use.
Kind regards,
David