General

Coordinator
Apr 12, 2008 at 7:35 AM
Post your questions & suggestions here !
Jan 20, 2010 at 5:28 PM
Edited Jan 20, 2010 at 7:00 PM

Hey Mikhail!

I am posting here to help SEO!

I am using the core and I know this is simple, but as you know. I claim to always be stupid. Maybe I am?

I have am trying to insert a new record but I get:

Object reference not set to an instance of an object.   here: Line 122:                _dao.SaveOrUpdate(modification);

I have simplified everything so that it only looks for one required field and the id, which is identity. I  have v

  

Modification.cs (editor doesn't paste well but here are the basics)

PersistentProperty: DocFee (as _docfee) & ModificationId (as _id)

 

<font size="2">

 

</font>

private int _id;

 

private string _docfee;

Default.aspx.cs

 

Modification modification = new Modification();

 

// modification.DocFee = DocFee.Text.Trim(); <font size="2">

modification.DocFee =

</font>

"500";<font size="2">

_dao.SaveOrUpdate(modification);

</font>

 

 

<font size="2">

 

</font>

 

Console.WriteLine("Saved Mod " + modification.DocFee + " ID:" + modification.Id);

 

 

 

 What did I miss??

just noticed code snippet in case you need it.

Coordinator
Jan 20, 2010 at 11:17 PM

Hi,

I think you need to create an instance of DataBaseObjectsFactorySQLServer class using your connection string:

private const string _connString = "server=LOCNOTE\\SQLEXPRESS;Initial Catalog=EasyPersistDemo;User Id=EasyPersistDemo;Password=123123;Trusted_Connection=no";
private DataBaseObjectsFactorySQLServer _dao = new DataBaseObjectsFactorySQLServer(_connString);
Thanks
Mikhail