During Open(), SqlConnection.ServerVersion throws System.InvalidOperationException - sqlconnection

When running a webservice, web page that knows how to respond. The service connects to a dbase. During the sqlconnection.open call, ASP .NET code throws the following exception:
sqlConnection.ServerVersion' threw an exception of type 'System.InvalidOperationException'
NOTE: I'm running this on my dev machine. When it runs on live web server, all is well. It is unique to my system.
I'm I missing a configuration setting with Sql Server 2008?
NOTE: recently upgraded from Sql Server 2005 to 2008

This could possibly be caused by a difference in your web.config between the live server and your dev machine. Have you checked that the connection string is properly specified?

Found problem. There was a space in the front of the connection string.

Related

MDM Operational server getting partially stared

I recently installed IBM MDM 11.5, DB2 and IBM WebSphere on my system. For some reason the Asset in MDM-operational-server is stopped and isn't getting started. I'm new to this and don't know what is causing the problem.
Business-level applications
MDM-operational-server-EBA-E001
If anything is required from my side then please let me know.
I tried restarting the server multiple times, tried running 'Madconfig redeploy_EBA' and even reinstalled the whole thing again but still after completion it's in the same state. If tried to execute any OOTB transactions, it's throwing the following error:
Error: Service bean could not be looked up on server iiop://localhost:2809 and provider url com/dwl/base/requestHandler/beans/DWLServiceController
com.ibm.mdm.tools.metadata.common.exceptions.MetadataException: javax.naming.NameNotFoundException: Context: INLEN8520069636Node01Cell/nodes/INLEN8520069636Node01/servers/server1, name: com/dwl/base/requestHandler/beans/DWLServiceController: First component in name requestHandler/beans/DWLServiceController not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]

Web Deploy not working. Timeout on client. Schannel 1203 on server

I'm trying to deploy an application via web deploy to a windows 2012 r2 server.
First tried installing iis, web deploy using the msi. After getting an unreachable error I saw somewhere that I needed wmsvc to be installed and installed it via powershell command Install-WindowsFeature Web-Mgmt-Service.
I stopped getting the unreachable error and started getting this error ->
Error: Could not complete the request to remote agent URL 'http://xx.x.xx.xx:8172/MSDEPLOYAGENTSERVICE'.
Error: The operation has timed out
On the server's event viewer under system I get the following error ->
A fatal alert was generated and sent to the remote endpoint. This may result in termination of the connection. The TLS protocol defined fatal error code is 10. The Windows SChannel error state is 1203.
Any idea of what could be going on? Did I miss something on the installation?
After this I also tried installing everything but without iis and I get the same error.
So, this is really not a PoSH issue.
Maybe you should consider movin gthis question to another forum.
Anyway, you have either real server config issues (this can sometimes mean wipe and rebuild - very ugly option - but if it's a virtual machine and you have a snapshot, just roll back), or an app causing this.
Typically for Schannel type of error, it has to do with application or service in machine not able to complete any SSL connection sort of connection.
The error state parameter of 1203 means client error connecting to server, ie invalid ClientHello from the client
See if you can collect more data by...
https://support.microsoft.com/en-us/help/260729/how-to-enable-schannel-event-logging-in-iis
I realized this is an old question, but in case somebody ran into the same issue, here are my solution.
I had to follow this guidelines : https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/configuring-server-environments-for-web-deployment/configuring-a-web-server-for-web-deploy-publishing-web-deploy-handler
Copy the resulting publishsetting file. In the Publish/Profile page import it.
In the Publish/Connection page, change the server to the server address with the 8172 port. Add the password. Change the Destination URL to the site to go to after the publish is completed.
Then after Validate connection was completed, go ahead and publish it!

Transient problems executing stored procedures on SQL Server 2008 R2

We are having an issue with SQL Server 2008 R2 64 responding to stored procedure call. About every 2 weeks or so, the database stops responding to stored procedures called from an ADO connection/Command set (4.0 framework). We have been working on this for several months now, with little improvement.
System changes:
We upgraded an existing vendor product from SQL Server 2005 to SQL Server 2008 R2 via their upgrade method. The database instance moved from a 32-bit Windows 2003 Server to 64-bit Windows 2008 Server.
The pattern of failure:
The application is run throughout the day, executed by different users via Citrix without issue. Every few weeks, the application stops responding around the same time frame. Once the database stops responding to the hosted instance of the application, any execution of the procedure from the application hangs (installed on CITRIX server, installed on varied physical systems, or debugging in VStudio 2010). After an hour of checking logs, server status, SQL Monitoring tools, tracing the repeated execution attempts, the server decides to respond to the application without intervention.
Strange thing is, when the server is not responding to ADO.Net calls, we execute the stored procedure from SQL Server Management Studio and receive results in 1 to 2 seconds. We are using the same login to access SQL Server Management Studio, and executing the stored procedure with the same parameters.
Looking at the connection string passed to the ADO connection, I don’t see anything unusual:
connectionString="Data Source=myserver\myinstance;Initial Catalog=databaseName;Persist Security Info=True;User ID=xxxxx;Password=yyyyy;Connect Timeout=45"
Tried so far:
Added extra 2gb of RAM to the OS: no change
Added extra tempdb file, expanded size of tempdb log file from 1 to 5gb: reduced the issue from weekly to every 2nd or 3rd week.
Installed SQL Server 2008 R2 SP3: no change.
The black cloud:
To me, the repeating time pattern of failure implies an issue at the database host (server or resource), but the DBAs do not see load or resource issue. If it were purely a host issue, why does it respond to SQL Server Management calls, and not ADO.NET calls?
The last occurrence lasted over two hours, and was resolved after rebooting the database server. Not a great fallback, but desperate times and all…..
Updating the ADO.NET connection to use named pipes has resolved the issue for our application. Prefixing the database name with "np:" has the connection using named pipes.
connectionString="Data Source=np:myserver\myinstance;Initial Catalog=databaseName;Persist Security Info=True;User ID=xxxxx;Password=yyyyy;Connect Timeout=45"
The issue returned on 5/14. This query timeout posting gave us hints how to force SQL Management Studio to behave like the ADO.NET connection and allowed us to recognize this is a "parameter sniffing" issue. We have applied changes to disable the parameter sniffing within the stored procedure.

Unable to connect to the remote server - Facebook Api

I am currently developing an application that uses the facebook api to get the posts from my feed.
I tested it locally using Visual Studio 2013 and it works just fine !
But when I publish it at IIS 7 it doesnt work.. it throws an exception while invoking the method Get of Facebook Client.
This is the error:
Exception Message: Unable to connect to the remote server
StackTrace of exception:
at Facebook.HttpHelper.OpenRead()
at Facebook.FacebookClient.Api(HttpMethod httpMethod, String path, Object parameters, Type resultType)
at Facebook.FacebookClient.Get(String path, Object parameters, Type resultType)
at FacebookProxy.WebUI.Default.LoadPosts(ControlCollection container, String upperPostId)
Maybe I need some special configuration on the IIS?
Thanks alot in advance
EDIT: I managed to attach the process to debug while launching the website from the IIS, and this was the inner exception message:
Inner Exception: No connection could be made because the target machine actively refused it 31.13.64.113:443
This only occurs while launching from my local IIS why? I already disabled all Firewall
solved, error on proxy. I need to open port at my network

ASP.NET mvc 2 app crashed on Windows 2008 R2 64 server

I have built a asp.net mvc 2 app, using the .NET framework 4.
It runs OK on my windows 7 (64 bit) machine, but when deploying to the server it gives me the following error:
Faulting application path: C:\Windows\SysWOW64\inetsrv\w3wp.exe
Faulting module path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
I suspect it has something to do with mixing 64 bit and 32 bit, but I have no clue whatsoever. This happens on different windows 2008 r2 servers, so it's not server (hardware) specific.
I did a BIN deployment of mvc 2 (copying system.web.dll, System.ComponentModel.DataAnnotations.dll, and system.web.routing to the BIN folder)
Update
The error occurs as soon as I try to access the database, a MS SQL 2008 server, via Linq-to-SQL.
Who can help me?
I found out why it crashed.
Most of the time a CLR.DLL error is caused by an infinite loop or something like that, just something really stupid.
In my case an unreachable SQL server (or rather: incorrect configured connection string) was causing the error. In my code, when reading or writing to the database failed the application tried write a log error to the same database. Which, of course, failed as well and caused an endless loop.
Yes, too stupid.