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

Related Questions

It seems at least weird to me... The program runs normally.But after I call
This code runs perfectly on Java but when I run this on Android platform,
The next code runs fine on my computer and does exactly what the problem
there is a difference between how the following code runs on sql2008 and sql2000.
http://jsbin.com/ilemoy/2/edit I've build some code but the animation runs at the same time. My
The next code uses igraph_neighborhood, and it runs good, i don't know why i
**the next code should parse a data from a webService to textView; Problem :
I have next code, <form id=form1 runat=server> <asp:Label runat=server ID=Label1 EnableViewState=false /> <asp:CheckBox runat=server
Someone explain why the next code returns a pointer inside ntdll.dll? GetProcAddress(LoadLibraryA(kernel32.dll), EncodePointer); GetProcAddress(LoadLibraryA(kernel32.dll),
i have written the next code: public void delete(MyType instance) { List<MyType> myList =

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.