My C# software with SQLEXPRESS Localdb database does not open on another PC, even installing all dependencies

Asked

Viewed 421 times

1

1 - My C# software with SQLEXPRESS Localdb database does not open on another PC, even installing all dependencies. NOTE: My Development PC works perfectly.

2 - Programs I have already installed in the Client: Microsoft SQL Server 2014 Express Localdb. Microsoft System CLR Types for SQL Server 2012.

3 - I’ve tried everything else I don’t know what else to do.

For now, I installed SQL Server Express 2014 as a Service, changed the Connection String and worked perfectly.

4 - The problem is being blessed of Localdb. Connectionstring that I’m using:

<connectionStrings>
<add name="dbMDD" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Corujasoft\LocalDB\dbMDD.mdf;Integrated Security=True;"
  providerName="System.Data.SqlClient" />
<add name="sdp.mdd.ui.Properties.Settings.dbMDDConnectionString"
  connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Corujasoft\LocalDB\dbMDD.mdf;Integrated Security=True;"
  providerName="System.Data.SqlClient" />

NOTE²: This is the same Connectionstring that works on my Development PC!

5 - Below are the Error Event Log from when I open my Software in client with Localdb Database:

ERROR LOG 1 - . NET Runtime

Aplicativo: sdp.mdd.ui.exe
Versão do Framework: v4.0.30319
Descrição: O processo foi terminado devido a uma exceção sem tratamento.
Informações da Exceção: System.Data.SqlClient.SqlException
   em System.Data.ProviderBase.DbConnectionPool.TryGetConnection(System.Data.Common.DbConnection, UInt32, Boolean, Boolean, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal ByRef)
   em System.Data.ProviderBase.DbConnectionPool.TryGetConnection(System.Data.Common.DbConnection, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal ByRef)
   em System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(System.Data.Common.DbConnection, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal, System.Data.ProviderBase.DbConnectionInternal ByRef)
   em System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions)
   em System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions)
   em System.Data.SqlClient.SqlConnection.TryOpenInner(System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>)
   em System.Data.SqlClient.SqlConnection.TryOpen(System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>)
   em System.Data.SqlClient.SqlConnection.Open()
   em NHibernate.Connection.DriverConnectionProvider.GetConnection()
   em NHibernate.Tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.Prepare()
   em NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords(NHibernate.Dialect.Dialect, NHibernate.Tool.hbm2ddl.IConnectionHelper)
   em NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update(NHibernate.ISessionFactory)
   em NHibernate.Impl.SessionFactoryImpl..ctor(NHibernate.Cfg.Configuration, NHibernate.Engine.IMapping, NHibernate.Cfg.Settings, NHibernate.Event.EventListeners)
   em NHibernate.Cfg.Configuration.BuildSessionFactory()
   em FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()

Informações da Exceção: FluentNHibernate.Cfg.FluentConfigurationException
   em FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
   em sdp.mdd.infra.NHFluentlyConfiguration.Configure(Boolean)
   em sdp.mdd.infra.NHSessionFactory.get_SessionFactory()
   em sdp.mdd.infra.GerenciadorSessao.InstanciarSessao()
   em sdp.mdd.infra.UnidadeTrabalho..ctor(sdp.mdd.infra.GerenciadorSessao)
   em sdp.mdd.aplicacao.AplicacaoBase..ctor()
   em sdp.mdd.ui.ViewLogin..ctor()
   em sdp.mdd.ui.Program.Main()

ERROR LOG 2: Applicationerror

    Nome do aplicativo com falha: sdp.mdd.ui.exe, versão: 2.0.0.0, carimbo de data/hora: 0x5ab14034
Nome do módulo com falha: KERNELBASE.dll, versão: 10.0.16299.309, carimbo de data/hora: 0xd3aa915c
Código de exceção: 0xe0434352
Deslocamento da falha: 0x001008f2
ID do processo com falha: 0x2cb0
Hora de início do aplicativo com falha: 0x01d3c2e6754ebbb9
Caminho do aplicativo com falha: C:\Corujasoft\sdp.mdd.ui.exe
Caminho do módulo com falha: C:\WINDOWS\System32\KERNELBASE.dll
ID do Relatório: 0d7f4f0d-6a2a-4fd6-95bf-ac2ee422d231
Nome completo do pacote com falha: 
ID do aplicativo relativo ao pacote com falha:

ERROR LOG 3: Windows Error Reporting

    Falha no bucket 1576448505465406206, tipo 5
Nome do Evento: CLR20r3
Resposta: Não disponível
ID do CAB: 0

Assinatura do problema:
P1: sdp.mdd.ui.exe
P2: 2.0.0.0
P3: 5ab14034
P4: System.Data
P5: 4.7.2633.0
P6: 5a4ed511
P7: 29fe
P8: 108
P9: J4US0MF0KIUDES4W53QMEUNNEKOCFJ5D
P10: 

Arquivos anexados:
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERAF70.tmp.mdmp
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB212.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB220.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB240.tmp.txt

These files may be available at:

C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_sdp.mdd.ui.exe_b6991ce4e3885917e466d7d84ddefc45e7486_fb161c74_00f5bc32

Symbol of analysis:

Verificando novamente solução: 0
ID do Relatório: 0d7f4f0d-6a2a-4fd6-95bf-ac2ee422d231
Status do Relatório: 268435456
Bucket com hash: a0b828bf5e9daf1b15e0ab9036f602fe

Please help me, I would so much like to not have to install Sqlserver Express 2014 via service on all my clients and yes only SQL Server Express Localdb which is much more Lightweight is fast to install, thank you.

  • Repair the path of your Localdb file: AttachDbFilename=C:\Corujasoft\LocalDB\dbMDD.mdf. When you run the program on your computer, the path C: Corujasoft Localdb is valid, but on another computer it is no longer a valid path, unless you convert your drive C: to be accessed by another computer (for example Z: Corujasoft Localdb), or set sharing permissions in that folder and use a UNC path (https://support.microsoft.com/pt-br/help/967030/what-is-unc-pathing), such as \DENER Corujasoft Localdb.

2 answers

1

Repair the path of your Localdb file: AttachDbFilename=C:\Corujasoft\LocalDB\dbMDD.mdf.

When you run the program on your computer, the path C:\Corujasoft\LocalDB is valid, but on another computer it is no longer a valid path, unless you convert your drive C: to be accessed by another computer, for example Z:\Corujasoft\LocalDB, or set sharing permissions in that folder and use a UNC path (https://support.microsoft.com/pt-br/help/967030/what-is-unc-pathing), as \\DENER\Corujasoft\LocalDB.

1

Use the Data Directory to signal that the database is located at the root of the application.

Thus:

<connectionStrings>
      <add name="CaminhoSQL" 
           providerName="System.Data.SqlClient" 
           connectionString="Data Source=(LocalDB)\MSSQLLocalDB;
                             AttachDbFilename=|DataDirectory|\PastaSehouverUma\NomedaDB.mdf;
                             Integrated Security=True"/>
</connectionStrings>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.