.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

SSMS and SQLCMD won't connect to valid SQL Instances

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :Sql Server

I have had Windows 7 for over a year now and a few months ago I was unable to connect to any SQL Server.  It worked at one time and I don't recall changing anything other than normal Windows updates.  What's really strange about this problem is that It just hangs.  If I put a valid SQL server it will hang and never throw an error.  NEVER.  It hangs indefinately.  If I put an invalid SQL server it will error out as it should.  I have spent 80 hours on this by now and am ready to re-install the operating system to see if it helps.  These are the things I have tried:

  • Uninstalling and re-installing SSMS
  • Used OSQL and SQLCMD to no avail
  • Disabling the firewall
  • Pinging the servers directly.  And I get a response.
  • Used the IP address of the server instead of the name
  • Disabling port 1433 on the firewall
  • I can create an ODBC connection to these instances
  • Begging and pleading with the PC


View Complete Post

More Related Resource Links

Can connect via SSMS but not SQLCMD/OSQL

I can connect to my SQL 2008 Express Edition server using SSMS.  I cannot connect using OSQL or SQLCMD and my application is having sporadic connection issues.  When I attempt to connect via OSQL, the following error is returned: Error: 18452, Severity: 14, State: 1.  Login failed.  The login is from an untrusted domain and cannot be used with windows authentication. The following are errors present in the SQL errorlog:  Error: 17806, Severity: 20, State: 2.  SSPI handshake failed with error code 0x8009030c while establishing a connection iwth integrated security; the connection has been closed. [CLIENT: <local machine>] Error: 18452, Severity: 14, State: 1.  Login failed.  The login is from an untrusted domain and cannot be used with windows authentication. I see an error in the application event log: Event 6037, LsaSrv  The program sqlservr.exe, with the assigned process ID 1788, could not authenticate locally by using the target name MSSQLSvc/{srvnm}.{workgrp}.net:{SQLinstancenm}.  The target name used is not valid.  A target anme should refer to one of the local computer names, for example, the DNS host name.  Try a different target name. Has anyone else experienced this issue - what else can I look into?      

sqlcmd, cannot connect to server

I have SQL Server installed on a machine called SQLDEV. I log on to that machine and I run the command sqlcmd -s SQLDEV -Q "select * from <db>.<schema>.<some_table> -E This command works and returns a result set.   Next, I go to a different machine. On that machine I can use SQL Mgmt Studio to log on to SQLDEV using window authentication. However, if I run the same command as above, I get some kind of a connection error. The error says, ".... When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections .....   Any suggestions/ideas why I am getting this error?

Can not connect to SQL 2005 Instances from Client

Dear Experts I have a problem. I am not able to connect to Remote SQL Server instances from my PC. Though some of my team members are able to connect to the Instances without any problem. We have tried with all the below options and no joy. 1. We tried connecting, with the IP Address, like IP\<ServerInstance>, Port# 2. Added the IP address to Host file with the network address and tried, like <WINServerName>.<networkaddress>\<ServerInstance>, Port#, even without the Port#. 3. Tried to create an ODBC DSN, why this because, this had resolved the issue some times. Thought will help, but didn't work out. After all these, whenever we tried to connect to the server, we received the below error message. Error Message : Can not connect to <WINSERVER>.NetworkAddress\<DBInstance> A network-related or instance-specific error occured 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 :TCP Provider, error:0 - No such Host is known) (Microsoft SQL Server, Error - 11001). Kindly help to resolve this issue. I have been strugling since quite some time. Regard Deepak

Cannot connect to SSRS from SSMS

I have an SSRS 2008R2 server with Forms Authentication (ie a custom security module). It's all setup, configured, running, and I can report on it fine. What I can't do is use SSMS to connect to the SSRS to configure ROLES etc. It reports: The username or password is not valid or you do not have permission to access this server. (Microsoft.SqlServer.Management.UI.RSClient) If I click on additional information I can see: Program Location:    at Microsoft.SqlServer.Management.UI.RSClient.RSClientConnection.CreateConnection()    at Microsoft.SqlServer.Management.UI.RSClient.RSConnectionInfo.GetRSConnectionObject(Boolean ensureOpenConnection)    at Microsoft.SqlServer.Management.UI.RSClient.RSConnectionInfo.RSTypeImpl.ProceedWithConnection(UIConnectionInfo ci)    at Microsoft.SqlServer.Management.UI.ConnectionDlg.RSType.Microsoft.SqlServer.Management.UI.ConnectionDlg.IServerType.ProceedWithConnection(UIConnectionInfo ci)    at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()   And if I look in the report server logs, I can see the following error:   library!ReportServer_0-10!eb0!09/15/2010-17:41:28:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.SecureConnectionRequiredException: , Microsoft.ReportingServices.Diagnostics.Utilities.SecureConnectionRequiredException:

Cannot connect to Reporting Services in SSMS using Servername



Kindly help me as i can't connect to Reporting Services in SSMS using SERVERNAME but using URL(http://localhost/ReportServer) I can connect. Here is the error I received. Please advice.

TITLE: Connect to Server

Cannot connect to PERRYDUNDOC-W7.


Unable to connect to the server at SERVERNAME. The specified URL might not be valid or there might be a problem with the report server version or configuration. Specify a different URL, or contact your server administrator to verify that the report server runs SQL Server 2008 or later. Additionally, if you are trying to connect to a SharePoint-integrated report server, verify that SharePoint is installed on the server and that the report server uses SharePoint integrated mode. (Microsoft.SqlServer.Management.UI.RSClient)




SSMS - Connect to Server dialog box - server history not showing


When I invoke SSMS, the "Connect to Sever" dialog box comes up.  Under the "Server Name" dropdown, it only displays a maximun of history entries (previously used connections/servers).  On other machines, it shows 10-15 previously used servers.

Does anyone know what I need to do or what needs to be configured on my machine to allow it to store my history entries?  If I connect to a new server, then one of the existing gets dropped off.  Just got tired of entering server names here...

Thank you very much.

Connect SQL Server 2005 SSMS to SQL Server 2008


is it ok to connect to sql server2008 server form sql server 2005 management studio. If yes, can you please let me know what should i do ?

Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

InfoPath 2010 cannot connect to SharePoint 2010

You have installed Office 2010 beta and you are trying to connect to SharePoint 2010 from InfoPath but you get an error

Multiple Instances of User Control


I have a user control that I place on a page severl times.  When I make a selection on a ddl in one one control the SelectedIndexChanged event fires for all the control on the page for that ddl.  So I get duplication of an insert that I do.  Is there a way to make sure these events are isolated so this doesn't happen.


could somebody give me example how I can connect to database only once if I use many models in contr


I use in my ASP.NET MVC application repository pattern and I use in controller for example 3 models:

   namespace MvcApplication1.Controllers  
        public class HomepageController : Controller  
            private IWebsitesRepository _repository_websites = new WebsitesRepository();  
            private IFirmRepository _repository_firm = new FirmRepository();  
            private IPhotosRepository _repository_photos = new PhotosRepository();  

In WebsiteRepozitory, FirmRepository and PhotosRepository classes I have:

Database1Entities _entities = new Database1Entities();

So I have 3 connections to database ? Is it wrong ? How can I solve it ?

ReportViewer :: Failed to enable constraints. But my statement is valid!!

  • A
  • n error has occurred during report processing.
      • Exception has been thrown by the target of an invocation.
        • Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

    Why do I keep getting this error, even when not using any data on the report. When I run the query in SQL server I get a resultset. However when I try to render the report I get this error.


    Path not valid.



    im trying to save a file, filename as current date and time.it will give an error.

    any ideas.

    here is my code

    string datetime=DateTime.Now.ToString();

    if (GridviewtoCSV("~/Admin/doc/Reports/" + batchid.ToString() + datetime + ".csv", transactiongrid) && GridviewtoPDF("~/Admin/doc/Reports/" + batchid.ToString() + datetime + ".pdf", transactiongrid))

    SAAS: Connect Enterprise Apps with Hosted BizTalk Services


    In this article we introduce you to BizTalk Services, new technology that offers the Enterprise Service Bus features of BizTalk Server as a hosted service.

    Jon Flanders and Aaron Skonnard

    MSDN Magazine June 2008

    Interop: Connect To Mainframe Apps With BizTalk Adapters and .NET


    If you have a significant investment in legacy COBOL applications running on mainframes, you need the BizTalk Adapters for Host Integration Server .

    Bashar "Bash" Badawi

    MSDN Magazine December 2007

    ASP.Net connect to Oracle.


     We have an application which uses  'System.Data.OracleClient'. On the box it was developed we can change the TNSNAMES.ORA entries to connect to different oracle databases. Moving the code to a  Microsoft Server 2008 box it would appear that the application ignores the TNSNAMES.ORA file. It has cached the first Oracle connection and will now work without any TNSNAMES.ORA file. Where is it getting the connection? We have set tns_admin to point at the TNSNAMES.ORA file. We can tnsping the connection OK.

    ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
    Sql Server  SharePoint  Silverlight  Others  All   

    Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend