views:

105

answers:

1

Hi There! I´m newer user in stack overflow and my english i´snt so good i hope you understand my trouble.

when I´m compiling my template this archives .cs it´s ok (Context, Structs), but in the ActiveRecord the code comes incomplete.

It seems that the system Break de compilation at line 5017 and not return any exceptions to me.

my code stops here:

public static PagedList<Veiculoopcional>

GetPaged(int pageIndex, int pageSize) { return GetRepo().GetPaged(pageIndex, pageSize);

    }

    public string KeyName()
    {
        return "

i guess this probably a limit of transmition or problem with my table "VeiculoOpcional".. i don´t know.

Any way this the strcture of the table:

CREATE TABLE `veiculoopcional` (
   `ID_Veiculo` int(11) NOT NULL,
   `ID_Opcional` int(4) NOT NULL,
   PRIMARY KEY (`ID_Veiculo`,`ID_Opcional`),
   KEY `FK_veiculoopcional_Opcional` (`ID_Opcional`),
   CONSTRAINT `FK_veiculoopcional_Opcional` FOREIGN KEY (`ID_Opcional`) REFERENCES `opcional` (`ID_Opcional`) ON DELETE NO ACTION ON UPDATE NO ACTION,
   CONSTRAINT `FK_veiculoopcional_Veiculo` FOREIGN KEY (`ID_Veiculo`) REFERENCES `veiculo` (`ID_Veiculo`) ON DELETE NO ACTION ON UPDATE NO ACTION
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

Anybody had or passed by this same problem ? i don´t found any refference in net

Many Thanks.

+7  A: 

SubSonic does not support composite primary keys (i.e. multiple column primary keys). Make the pair ('ID_Veiculo','ID_Opcional') unique, add a new column, and make the new column your primary key.

sparks
Thanks Spark! That Works for me Thanks, i just not make the Thirdy column with PK because it´s a low Table.Regards
Myr0