yo_bee
asked on
VB.NET app cannot connect to MSSQL DB on a WIndows 10 machine
I have a home grown vb.net desktop application I built years ago for my Windows 7 environment. This application connect to a MSSQL database. Now I am trying this out on a Windows 10 machine (1803 build) and I am getting this error.
When I open Visual Studio to see if I can address this by playing around with the connection string, but still no luck.
Any advise :)
When I open Visual Studio to see if I can address this by playing around with the connection string, but still no luck.
Any advise :)
have you moved your database to a new server? It looks like you are not using TCP/IP which is off by default when you install a new server
ASKER
But that is the thing. I am using TCP/IP to connect and it works perfectly fine on Window 7.
I have SMSS installed on my Windows 10 and I am able to connect as well as connect within Visual Studio. The app that is having an issue. Am I missing something within the application for W10 to work?
I have SMSS installed on my Windows 10 and I am able to connect as well as connect within Visual Studio. The app that is having an issue. Am I missing something within the application for W10 to work?
What is your connections string?
I don't believe that SMSS normally uses TCP/IP. You may have to enable TCP/IP in your driver and/or database settings. I have always had to do that with new installations.
ASKER
Data Source=xxxxx.yyyyy.local;I nitial Catalog=Inventory;Integrat ed Security=True
add:
Network Library=DBMSSOCN;
ASKER
where in the string and what does the syntax look like
Data Source=xxxxx.yyyyy.local;Initial Catalog=Inventory;Integrated Security=True;Network Library=DBMSSOCN;
the error says it all. the server was not found
ASKER
I understand that, but it is pingable both by the IP and FQDN. So I am not sure why Windows 10 is unable to see it via the app
ASKER
in addition to the info stated above I am able to query data from within project via the DATASET.
If it's pingable, then I'd suggest checking to see if there's a firewall enabled on the Windows 10 machine that is blocking outbound traffic on port 1433 (or blocking everything except certain ports/applications - some security software will block all network communication from unknown applications unless you whitelist it).
Alternatively, if the server is set up to only accept traffic on port 1433 from certain IPs/subnets - that's worth checking out.
Alternatively, if the server is set up to only accept traffic on port 1433 from certain IPs/subnets - that's worth checking out.
ASKER
from command prompt I am able to resolved FQDN via a ping as well as IP. I am able to navigate to the \\servername\share via File Explorer. I can connect to the SQL server in SMSS. I do not think its a DNS issue
ASKER
No firewalling enabled. Note that Windows 7 works on port 1433.
This is a Windows 10 issue
This is a Windows 10 issue
>>in addition to the info stated above I am able to query data from within project via the DATASET.
Check the connection string on that object
ASKER
Not sure what you are asking in your last comment.
ASKER
Being that this was built on a .Net 4.0 and my Windows 10 machine has .Net 4.7 would that be an issue?
Here is a JiT dump:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Data.SqlClient.SqlE xception (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win3 2Exception (0x80004005): Access is denied
at System.Data.SqlClient.SqlI nternalCon nectionTds ..ctor(DbC onnectionP oolIdentit y identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandlin g, SqlAuthenticationProviderM anager sqlAuthProviderManager)
at System.Data.SqlClient.SqlC onnectionF actory.Cre ateConnect ion(DbConn ectionOpti ons options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.D bConnectio nFactory.C reatePoole dConnectio n(DbConnec tionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.D bConnectio nPool.Crea teObject(D bConnectio n owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.D bConnectio nPool.User CreateRequ est(DbConn ection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.D bConnectio nPool.TryG etConnecti on(DbConne ction owningObject, UInt32 waitForMultipleObjectsTime out, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.D bConnectio nPool.TryG etConnecti on(DbConne ction owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.D bConnectio nFactory.T ryGetConne ction(DbCo nnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.D bConnectio nInternal. TryOpenCon nectionInt ernal(DbCo nnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.D bConnectio nClosed.Tr yOpenConne ction(DbCo nnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlC onnection. TryOpenInn er(TaskCom pletionSou rce`1 retry)
at System.Data.SqlClient.SqlC onnection. TryOpen(Ta skCompleti onSource`1 retry)
at System.Data.SqlClient.SqlC onnection. Open()
at System.Data.Common.DbDataA dapter.Fil lInternal( DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataA dapter.Fil l(DataTabl e[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataA dapter.Fil l(DataTabl e dataTable)
at WindowsApplication1.Invent oryDataSet TableAdapt ers.Table1 _1TableAda pter.FillB yUser(Tabl e1_1DataTa ble dataTable, String Param1)
at WindowsApplication1.Form1. Searchbtn_ Click(Obje ct sender, EventArgs e)
at System.Windows.Forms.Contr ol.OnClick (EventArgs e)
at System.Windows.Forms.Butto n.OnClick( EventArgs e)
at System.Windows.Forms.Butto n.OnMouseU p(MouseEve ntArgs mevent)
at System.Windows.Forms.Contr ol.WmMouse Up(Message & m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Contr ol.WndProc (Message& m)
at System.Windows.Forms.Butto nBase.WndP roc(Messag e& m)
at System.Windows.Forms.Butto n.WndProc( Message& m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.OnMessa ge(Message & m)
at System.Windows.Forms.Contr ol.Control NativeWind ow.WndProc (Message& m)
at System.Windows.Forms.Nativ eWindow.Ca llback(Int Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
ClientConnectionId:0000000 0-0000-000 0-0000-000 000000000
Error Number:5,State:0,Class:20
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3101.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microso ft.NET/Fra mework/v4. 0.30319/ms corlib.dll
-------------------------- ---------- ----
FLH_HelpDesk_Util
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file://FileServer01/Data/A pps/Tools/ Remote%20S upport.exe
-------------------------- ---------- ----
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 14.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ MSIL/Micro soft.Visua lBasic/v4. 0_10.0.0.0 __b03f5f7f 11d50a3a/M icrosoft.V isualBasic .dll
-------------------------- ---------- ----
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Windows. Forms/v4.0 _4.0.0.0__ b77a5c5619 34e089/Sys tem.Window s.Forms.dl l
-------------------------- ---------- ----
System
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m/v4.0_4.0 .0.0__b77a 5c561934e0 89/System. dll
-------------------------- ---------- ----
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Drawing/ v4.0_4.0.0 .0__b03f5f 7f11d50a3a /System.Dr awing.dll
-------------------------- ---------- ----
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Configur ation/v4.0 _4.0.0.0__ b03f5f7f11 d50a3a/Sys tem.Config uration.dl l
-------------------------- ---------- ----
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3101.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Core/v4. 0_4.0.0.0_ _b77a5c561 934e089/Sy stem.Core. dll
-------------------------- ---------- ----
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Xml/v4.0 _4.0.0.0__ b77a5c5619 34e089/Sys tem.Xml.dl l
-------------------------- ---------- ----
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ MSIL/Acces sibility/v 4.0_4.0.0. 0__b03f5f7 f11d50a3a/ Accessibil ity.dll
-------------------------- ---------- ----
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Runtime. Remoting/v 4.0_4.0.0. 0__b77a5c5 61934e089/ System.Run time.Remot ing.dll
-------------------------- ---------- ----
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ 32/System. Data/v4.0_ 4.0.0.0__b 77a5c56193 4e089/Syst em.Data.dl l
-------------------------- ---------- ----
System.Data.DataSetExtensi ons
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Data.Dat aSetExtens ions/v4.0_ 4.0.0.0__b 77a5c56193 4e089/Syst em.Data.Da taSetExten sions.dll
-------------------------- ---------- ----
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ MSIL/Syste m.Numerics /v4.0_4.0. 0.0__b77a5 c561934e08 9/System.N umerics.dl l
-------------------------- ---------- ----
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ 32/System. Transactio ns/v4.0_4. 0.0.0__b77 a5c561934e 089/System .Transacti ons.dll
-------------------------- ---------- ----
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso ft.Net/ass embly/GAC_ 32/System. Enterprise Services/v 4.0_4.0.0. 0__b03f5f7 f11d50a3a/ System.Ent erpriseSer vices.dll
-------------------------- ---------- ----
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Here is a JiT dump:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Data.SqlClient.SqlE
at System.Data.SqlClient.SqlI
at System.Data.SqlClient.SqlC
at System.Data.ProviderBase.D
at System.Data.ProviderBase.D
at System.Data.ProviderBase.D
at System.Data.ProviderBase.D
at System.Data.ProviderBase.D
at System.Data.ProviderBase.D
at System.Data.ProviderBase.D
at System.Data.ProviderBase.D
at System.Data.SqlClient.SqlC
at System.Data.SqlClient.SqlC
at System.Data.SqlClient.SqlC
at System.Data.Common.DbDataA
at System.Data.Common.DbDataA
at System.Data.Common.DbDataA
at WindowsApplication1.Invent
at WindowsApplication1.Form1.
at System.Windows.Forms.Contr
at System.Windows.Forms.Butto
at System.Windows.Forms.Butto
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Butto
at System.Windows.Forms.Butto
at System.Windows.Forms.Contr
at System.Windows.Forms.Contr
at System.Windows.Forms.Nativ
ClientConnectionId:0000000
Error Number:5,State:0,Class:20
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3101.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microso
--------------------------
FLH_HelpDesk_Util
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file://FileServer01/Data/A
--------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 14.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3101.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microso
--------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
System.Data.DataSetExtensi
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/Windows/Microso
--------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
ASKER
Update:
I created a brand new Form with a Datagrid to the same SQL server. This was successful.
Something in my app does not like the old datagrid and connection.
I created a brand new Form with a Datagrid to the same SQL server. This was successful.
Something in my app does not like the old datagrid and connection.
ASKER
Sorry about the zero activity on this. Weird thing. It started working. I do not know if there was an update at the time that broke this and a future one resolved it, but the issue not longer exist.
I suspect something was changed on your server or firewall
ASKER
Nothing firewall related. The only thing I can chalk it up to is that there was a Windows update
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.