views:

43

answers:

1

Subsonic 3.0 is updating multiple rows instead of just the one it's supposed to

 DB Table is defined as follows -
 Col1 int NOT NULL
 Col2 Text NOT NULL
 Col3 INT NOT NULL
 ColX NTEXT
 COLY NTEXT

 Primary Key = Col1 + Col2 + Col3
 ....

the select expr is as follows

 myTable a = myTable.SingleOrDefault( x => x.Col1 = 1 && x.Col2 = 'abc' && x.Col3 = 9 );
 if ( a == null )
 {
     // not relevant in this case !
 }

 .... some code 
 a.ColX = myString1;

 a.Update();

@ this point all the rows where Col1 = 1 are set to myString1

What am i doing wrong here ?

Any fixes/workarounds ? this is super urgent !

env - db is sql 2008 R2 Express, .net 3.5, c#

A: 

SubSonic does not appear to support composite primary keys - you'll have to create a surrogate key to do what you want.

See also: http://stackoverflow.com/questions/1183595/subsonic-3-and-multiple-pk-columns/1185070#1185070

John Rasch
doh ! i suppose it helps to read the feature set before using a product :) thanks !
Kumar