Save in SQL 2005

Jan 30, 2008 at 8:32 AM
Hi,

I'm trying to use the ODX, but I'm facing some problems with the save.
I have a table in a SQL Server 2005 database with an Identity field. (which never can be updated).
Now I created the table Class (as shown in examples) and I can get the data from the database. No problem.
I use following code:

string conString = ConfigurationManager.ConnectionStrings"DefaultBusinessConnectionString".ToString();
DbDataProvider provider = new DbDataProvider(System.Data.SqlClient.SqlClientFactory.Instance, conString);
s = new Session(provider);
s.RegisterAssembly(Assembly.GetExecutingAssembly());
s.Prepare();

Then on my form, i have a datagridview which is binded as followed:
dataGridView1.DataSource = s.All<ImportAccount>();

No problem so far.
But now I change some fields, not the identity field and want to save this to the database:
s.Save(SaveMode.Complete);

Then I receive an error from SQL Server that it is not possible to update the Identity field.

I know that, but how can I save my changes to database ?????
I have tried the different save modes, but it does not work.