Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

I made a adminstration project with Visual studio 2015 and a sql database file mdf, the Sql server is from 2016. In my pc1(windows 10 enviroment) which I created this project , the first rebuiled release is woking nice without any problems. But this application with the database needs do work at a another pc2 (window 10 enviroment). so I installed the release at this pc2 with the required databases and Sql server 2016 (with same sql server configuraion as pc1). In pc2 includs also the SSMS(V18.4) which was also installed in pc1 to creade a *mdf database.

The problem is when I start the apllication at pc2, somehow it can not connect to the database, while every thing is set it up as pc1 besides(username , pc name). Af the 30sec timeframe, I get a message which is coming from my try and catch code which generates SQL interfaces error 0X89C50118




The configuration of the connection strings of the application looks like below below which simliar as pc1

XML
?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="Kim_s_Uren.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <connectionStrings>
        <add name="Kim_s_Uren.My.MySettings.GasouderbureauConnectionString"
            connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Gasouderbureau.accdb;Persist Security Info=True"
            providerName="System.Data.OleDb" />
        <add name="Kim_s_Uren.My.MySettings.GastouderbureauConnectionString"
            connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Gastouderbureau.accdb"
            providerName="System.Data.OleDb" />
        <add name="Kim_s_Uren.My.MySettings.KinderenConnectionString"
            connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Kinderen.accdb"
            providerName="System.Data.OleDb" />
        <add name="Kim_s_Uren.My.MySettings.BuroInfoConnectionString"
            connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\database\BuroInfo.mdf;Integrated Security=True;Connect Timeout=30"
            providerName="System.Data.SqlClient" />
        <add name="Kim_s_Uren.My.MySettings.BuroInfoConnectionString1"
            connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\BuroInfo.mdf;Integrated Security=True;Connect Timeout=30"
            providerName="System.Data.SqlClient" />
        <add name="Kim_s_Uren.My.MySettings.BuroInfo_2019ConnectionString"
            connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\BuroInfo_2019.mdf;Integrated Security=True;Connect Timeout=30"
            providerName="System.Data.SqlClient" />
        <add name="Kim_s_Uren.My.MySettings.BuroInfo_2019ConnectionString1"
            connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\database\2019\BuroInfo_2019.mdf;Integrated Security=True;Connect Timeout=30"
            providerName="System.Data.SqlClient" />
        <add name="Kim_s_Uren.My.MySettings.BuroInfo_2020ConnectionString"
            connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\database\2020\BuroInfo_2020.mdf;Integrated Security=True;Connect Timeout=30"
            providerName="System.Data.SqlClient" />
        <add name="Kim_s_Uren.My.MySettings.BuroInfo_2021ConnectionString"
            connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\database\2021\BuroInfo_2021.mdf;Integrated Security=True;Connect Timeout=30"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
    <startup>
        
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup>
    <applicationSettings>
        <Kim_s_Uren.My.MySettings>
            <setting name="test" serializeAs="String">
                <value />
            </setting>
        </Kim_s_Uren.My.MySettings>
    </applicationSettings>
</configuration>

The things which I have checked is
- In PC2 With SSMS I have attached the required mdf files and the SSMS with out any problems
I can enter the database with the SSMS and see already the data whioch was filled in with my new
application

-Checked the settings in SQL SERVER Configuration manager and thisshould be ok because the settings
is similars as pc1

-The security of the folders(database and application) is set for everybody(full user rights).

-The neccesary service for the sql is running

After all these checks still I get this SQL interface error and it drives me up to the ceiling.


Does somebody have som suggestion about this interface error?

Kind regards

Ferry

What I have tried:

The things which I have checked is
- In PC2 With SSMS I have attached the required mdf files and the SSMS with out any problems
  I can enter the database with the SSMS and see already the data whioch was filled in with my new 
  application

-Checked the settings in SQL SERVER Configuration manager and thisshould be ok because the settings 
 is similars as pc1

-The security of the folders(database and application) is set for everybody(full user rights).

-The neccesary service for the sql is running
Posted
Updated 19-Dec-20 4:23am
v2

1 solution

I suspect you tried to copy the MDF file directly which is not the recommended way, for more information see: Copy Databases to Other Servers - SQL Server | Microsoft Docs[^]

I also know that using LocalDB can give lots of problems, I would not recommend using it.
SQL Server Express LocalDB - SQL Server | Microsoft Docs[^]

It could be related to a locking issue described here: How to fix "LocalDB - Requested Login failed"[^]
 
Share this answer
 
v2
Comments
Member 14895475 19-Dec-20 8:55am    
thanks for ths info, it seems with new SSMS you need to backup and restore for copy the database and restarted the MSSQL server
, so I have done this but unfortunaltly the error remains.....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900