tags:

views:

250

answers:

2

I don´t know the answer for this question.

With MSSQLSERVER and MYSQL the next configuration runs very well but with Oracle don´t.

With Oracle appear like this

Cargo c = new Cargo(); c.Idcargo = 1;

With MSSQL AND MYSQL

c.IdCargo = 1;

How to configure the connection with Oracle to appear "IdCargo" and not "Idcargo". ??

THE CONFIGURATION:

 <providers>
  <clear/>
        <add name="oracle" type="SubSonic.oracleDataProvider, SubSonic"
   connectionStringName="oracle"
   fixDatabaseObjectCasing="true"
   regexDictionaryReplace="Empresaendereco,EmpresaEndereco;Empresacontato,EmpresaContato;Franqueadoendereco,FranqueadoEndereco;Franqueadocontato,FranqueadoContato;Funcionarioacesso,FuncionarioAcesso;Funcionarioendereco,FuncionarioEndereco;Funcionariocontato,FuncionarioContato;Clienteendereco,ClienteEndereco;Clientecontato,ClienteContato;Clientehistorico,ClienteHistorico;Agendastatus,AgendaStatus;Historicostatus,HistoricoStatus"
   generateRelatedTablesAsProperties="true"
   fixPluralClassNames="false"
   generatedNamespace="ModeloDados"
   regexIgnoreCase="false"
   removeUnderscores="false"
   setPropertyDefaultsFromDatabase="true"
   generateNullableProperties="true"
   useExtendedProperties="true" useUtc="true"/>
 </providers>
+1  A: 

Valmir, What does the definition of your Cargo Table look like? I am betting that your error is coming from Oracle and not SubSonic if your definition looks something like this

Create Table Cargo(
ldCargo Decimal(12,0) )

Than your property in subsonic will not come across as ldCargo. This is due to the fact that Oracle stores all of the column names and table names as upper case. You would need to change ldCargo to ld_cargo if you would like to have it come across in SubSonic as camel case (SubSonic will remove the "_" for you)

runxc1 Bret Ferrier
Hi runxc1, I created one more field in the table like Descricao_Teste and of course set removeUnderscores="true" in the web.config This way work.....I tried to create the table columns as camel case but in oracle always stay in upper case .Do you know other way to solve this ?
Valmir
you shouldn't need to set remove underscores="true" as it is the default. Using all of the defaults when I have a column named c_test_info_id SubSonic will convert this to CTestInfoId
runxc1 Bret Ferrier
A: 

As runxc1 says Oracle does not respect case for column/table names, your regexdictionaryreplace config is, I imagine, hiding the issue for tables. You can force oracle to be case sensitive in your db creation scripts by surrounding table/column names with quotes however I believe that has it's own drawbacks:

http://www.dbforums.com/oracle/1005513-column-name-any-convention.html#post3705627 http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/column-name-case-771715

Since you are having the same problem with MySql I would suggest you move to using underscores (once again as runxc1 says) for your db table/column naming conventions then you can remove the regexdictionaryreplace completely.

Adam
As Adam points out you can change Oracle so that it respects case but everyone tells me it is a big NONO and will cause many other errors.
runxc1 Bret Ferrier
Yes, thanks Adam. with quotes in column name works ... in this project i can´t change the all columns to use "_" , but in the next maybe I change....Thank you very much for your help again.
Valmir