Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 213041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:14:31+00:00 2026-05-11T18:14:31+00:00

The next code runs normally in SQLSERVER but when i change the web.config to

  • 0

The next code runs normally in SQLSERVER but when i change the web.config to runs with mySQL after the loadbykey the connection is closed.

is there any configuration to make in MYSQL to change that ???

thanks any help !!!

    //-----------------------------------------------------------
    string tipoBanco = System.Configuration.ConfigurationManager.AppSettings["tipoBanco"];
    string conexao = System.Configuration.ConfigurationManager.ConnectionStrings[tipoBanco].ToString();

    using (SharedDbConnectionScope scope = new SharedDbConnectionScope(conexao))
    {
        //-----------------------------------------------------------
        using (TransactionScope ts = new TransactionScope())
        {
            Cargo c = new Cargo();
            c.LoadByKey(9999);

            SubSonic.StoredProcedure sp = null;
            sp = new SubSonic.StoredProcedure("sp_test");
            sp.Command.AddParameter("paramTabela", "zzz", DbType.AnsiStringFixedLength, null, null);

            Convert.ToInt32(sp.ExecuteScalar());
        }
    }

the web.config

<SubSonicService defaultProvider="mysql" enableTrace="false" templateDirectory="">
    <providers>
        <clear/>
  <add name="mysql" type="SubSonic.MySqlDataProvider, SubSonic"
             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"
             fixDatabaseObjectCasing="true" connectionStringName="mysql"
             generateRelatedTablesAsProperties="true"
             fixPluralClassNames="false"
             generatedNamespace="ModeloDados"
             regexIgnoreCase="true"
             removeUnderscores="false"
             setPropertyDefaultsFromDatabase="true"
             generateNullableProperties="true"
             useExtendedProperties="true"
             useUtc="true" />

</providers>
</SubSonicService>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:14:31+00:00Added an answer on May 11, 2026 at 6:14 pm

    I think your TransactionScope() and SharedDbConnectionScope() are the wrong way round. You have them in the order they were listed in the docs on the SubSonic web site, but there was a discussion on the old SubSonic forum that implied they should be the other way round.

    Certainly I use them reversed (I have just posted an extract of my code to another answer on here), but I have to say I only use MSSQL ATM, and can’t comment on MySQL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 313k
  • Answers 313k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Your problem is kAudioFormatMPEGLayer3 Unfortunately you can't encode sound on… May 13, 2026 at 10:55 pm
  • Editorial Team
    Editorial Team added an answer Create a UIButton in interface builder, change the type to… May 13, 2026 at 10:55 pm
  • Editorial Team
    Editorial Team added an answer I've eventually gone for this solution, which works for summing… May 13, 2026 at 10:55 pm

Related Questions

We currently have a custom inventory system used to track different assets. The items
On the subject of dynamically storing temporary images and handling their cleanup on a
While doing some JavaScript performance tests I came up with the following piece of
I have a problem where I get a deadlock on a MS SQL Server.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.