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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

connectivity issue with local instance of sql server

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :.NET Framework
 

hi everbody,

well for the last couple of days i have almost taken my head out to get this issue resolved.

but still i am no where. i have already referred to so many tips available online but still can't fix the prob.

i am trying to connect a C# ( .net 2005) program to connect to the  integrated sql server 2005 instance on my local computer.

i have got windows 7 home basic on my pc with .net frame work 2.0 sp2 and have also upgraded to sql server 2005 sp3 as per some online study.

i have also tried all these steps but still getting the error 40.

1. Check Whether the SQL Server is running or not.
Because the trial to connect to the stopped server may also cause this problem.

2. Check the name of the SQl Server.
For example, if we try to connect to SQL server using .NET application, for some SQL Server, the name of the server "localhost" works, but for some server, we may need to mention "(local)".

3. Check Whether the SQL Browser Service is running

4. Check Whether the TCP/IP is enabled for SQL Server Configuration

* Expand SQL Server Configuration Manager
* Enable TCP/IP

5. Firewall Settings

You may need to add the port of Sql server to the Firewall if it is other than the default port(1433).

Go to Control Panel | Win


View Complete Post


More Related Resource Links

How to connect to local instance of SQL Server 2008 Management Studio Express ?

  

I just installed SQL Server 2008 Management studio Express on my Vista machine.

i tried connecting to local machine using :

.\sqlexpress, (local)\sqlexpress, or .\SQLExpress, MyPCNAME\SQLExpress

nothing is working, getting this error:

-----------------------------
Cannot connect to PC-NAME\SQLEXPRESS. 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
----------------------------


Failed to generate a user instance of SQL Server due to failure in retrieving the user's local appl

  
Hi ,From the last few days I am struggling with the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed."I hav created an asp.net web application with membership shcema. It works fine an my developement machine but when I published it on my web server. It is giving me above error for which I searched but not found any help.Can anyone help me with this.

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local appl

  
Hi,I spend two days looking for an anwser to this problem but no luck. I have a simple ASP.NET 2.0 application which run correctly on my local machine. But After uploading all files including web.config file on a Windows 2003 Server with SQLEXPRESS installed. I have this error. Please Help!!!!!! Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local appl

  
Hello everybody.I am working on Login control and I am new in ASP.NET. So far what I did is :1. In Website->ASP.NET Configuration I change the form authentication to internet.2. I created a user profile3. This gave me a ASPNETDB.mdf database.4. I added this code :<connectionStrings> <remove name="LocalSqlServer" /> <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> </connectionStrings> in web.config file.4. I added login control to my login page :<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" Title="Untitled Page" %><asp:Content ID="MainContent" ContentPlaceHolderID="MainContentPlaceHolder" Runat="Server"> <h1>Please Login</h1> <asp:Login ID="LoginAuth" runat="server" > </asp:Login></asp:Content> 5. And the login.aspx.cs file has :using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.W

Cannot connect to Sql Server Local Instance

  
Hello allI just installed sql server 2005 to my pc and when i try to log in to the server instance i get an error log in failed for user xxx (error 18456). I browse to the server instance and i keep getting the same error even though i chose windows authentication option during the installation. I restarted the service for the sql server instance (which is running).The only problem i can think about is a problem with permissions but again there should not be any problem there because i logged in as administrator. Any suggestions please!!!

problem with connecting to local SQL Server 2008 default instance using windows authentication

  

Hello, 

 

I have a user getting some problem with connecting to local SQL Server 2008 default instance using windows authentication with a user which has sysadmin role and is owner of each existing database:

2010-09-28 15:40:35.04 Logon       Error: 18456, Severity: 14, State: 11.

 

2010-09-28 15:40:35.04 Logon       Login failed for user 'IIS APPPOOL\RoomViewSEWebClient'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: 127.0.0.1]

 

 

This us

SQL Server 2005 Express Connectivity Issue

  

I have a virtual dedicated 2003 server (standard edition) on which I installed SQL Server Express 2005 in mixed mode.  After installing the server I added the 2010 Web Developer package.  I updated the remote connections to allow TCP/IP and named pipes.  I also ensured that the TCP/IP protocol was enabled under the protocols tab.  After restarting the SQLEXPRESS service and attempting to configure a SqlDataConnection in Web Developer I got the ubiquitous error,

"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 the instance name is correct and that the SQL Server is configured to allow remote connections.  (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)". 

When I try using a trusted connection with sqlcmd I got this error,

"HResult 0x2, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [2].
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. 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..
Sqlcmd: Error: Microsoft SQL Native Client : Log

SQl Server Express 2008 connecting to instance issue

  

Hi all,

First time user here.

Need some advice on connecting to a database or instance. Keep getting error message when i try to connect to instance.

Error message when I try to connect to instance refers to veryfying that the instance name is correct and to also check that remote connections are enabled.

I just cant connect at all.

I have enabled TCP/IP in config manager tool for sql server.

I am trying to do this locally.

TCP/IP and shared name pipes is enabled.

How do I verify that the instance name is correct?

And one silly question I think, why dont I have sql browser service in Services?

Any help would be greatly appreciated.


Sql server 2008 R2 x64 / SSMS : Intermittent Connectivity Issue

  

I have read almost everything on this topic, applied each proposed solution, checked all conf settings but I am stil stuck with these frequent but intermittent connectivity issues.

I moved our databases from a win 2003 + SQL Server 2005 x86 enterprise (where I had no connectivity issue) to a clean install of SQL server 2008 R2 x64 enterprise on Windows Server 2008 R2 x64. Enabled tcp/ip & named pipes, recreated the users (& fixed orphans), opened ports on firewalls client, hardware, even Win Server although it is disabled, applied the UC4 patches, tried various connection strings, created aliases (for x64 and x32), ran the different recommended tools (portQryV2...) to no avail.

Most of the time, I can connect, with SSMS or via code with SqlConnection and execute queries. But frequently, I either lose the connection or cannot connect on the first call. Then it works on subsequent calls. In vb, the  code hangs on the call of the open method of the SqlConnection (and yes I properly close my connections once the queries have been executed). Setting the CommandTimeout has no effect. The code/SSMS freezes for 30/40 seconds.

No error is showing up in the Profiler, Nothing in the SQL Server Logs. The client and the server are on different networks. I connect via TCP/IP(remot

Issue to install a new instance SQL Server 2008 SP1

  

Hi,

I have an issue when I want to install a new instance SQL Server 2008 on server which already contains 2 instances.

My screen is blocked on the step "Feature Selection". So I noticed when I compared both logs one of a correct installation and my installation log some differences (below the log of the file detail.txt)

"

Log of my installation KO
--------------------------
2010-11-12 18:36:43 Slp: Package ID sql_tools_Cpu64: match result for Discovery - Version: True, Cpu: False, Language: True
2010-11-12 18:36:43 Slp: Package ID sql_tools_Cpu64: match result for Discovery - Version: True, Cpu: False, Language: True
2010-11-12 18:36:43 Slp: Package ID sql_tools_Cpu64: match result for Discovery - Version: True, Cpu: False, Language: True
2010-11-12 18:36:43 Slp: Package ID sql_tools_Cpu64: match result for Discovery - Version: True, Cpu: False, Language: True
2010-11-12 18:36:43 Slp: Package ID sql_tools_Cpu64: NotInstalled - Package was found but determined as NotInstalled because at least one of C


Log of an installation OK
--------------------------
2010-08-26 15:19:09 Slp: Package ID sql_tools_Cpu64: Installed - Version: 10.1.2531.0

*********

Log of my installation KO
--------------------------
2010-11-12 18:36:43 Slp: Package ID sql_tools_loc_Cpu

SQLCF 3.5 SP2 Replication Issue: An instance of the SQL Server Reconciler error object cannot be cre

  
Hi, we have a desktop application synchronizing with our SQL server using merge replication via IIS6.

Previously we used SQL2005 Ent database server, SQLCF 3.5SP1 tools and runtime library were installed on IIS machine, the desktop application was compiled with SQLCF 3.5 SP1 runtime as well.

Last week we upgraded our server to SQL 2008 R2, the application has been broken since then.

We tried to upgrade to SQLCF 3.5 SP2 tools and runtime on IIS ==> didn't help
We tried to install SQLCF 3.5 SP2 on the desktop where the application running (but left the application unchanged) ==> didn't help

Could anybody here help me with this? Do I need to re-compile my application?

Here are some debug information:
SQLCESALOG.TXT: Thread=1284 RSCB=1 Command=SYNC Hr=00000000 Failed to use 10.0 error components. Exiting... 0

Diagnostics:
Impersonation and Access Tests Action Status ErrorCode
Impersonate User SUCCESS 0x0
ReadWriteDeleteMessageFile SUCCESS 0x0

SQL Server Compact Modules Test Module Status ErrorCode Version
sqlcerp35.dll SUCCESS 0x0 3.5.8080.0
sqlcesa35.dll SUCCESS 0x0 3.5.8080.0

Reconciler Test Reconciler Status ErrorCode
10.0 Database Reconciler SUCCESS 0x0
9.0 Database Reconciler SUCCESS 0x0


Any help would be appreci

Word Automation Issue in Windows Server 2008 Hosting

  

Hi,

The problem I am posting here is that I was facing nearly 2 weeks around. Any body comes with this stuff please help.

Word Automation in sample ASP.NET(C#) application.

I am using Microsoft.Office.Inetrop.Word Assembly for automation. Here I am reading a XXX.dot template file and fill the contents with dynamic data.

When i am executing my code in localhost:someportnumber the automation is working fine and I could get expected result and when I am hosting in my inetmgr(Windows XP is my OS) it is also working fine.

But the problem is that when I am hosting in my production server(Windows Server 2008 Standard Edition) I am not able to perform automation and results in the following error.

Data: System.Collections.ListDictionaryInternal
Message: Word has encountered a problem.
Source: Microsoft Word

The code gets failed in the following line:

ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();

Document wordDoc = wordApp.Documents.Add(ref oTemplate, ref oFalse, ref oMissing, ref oMissing); // Error in this line

I cannot able to proceed further. Can anybody please help me in solving this issue?

Thank you.


With Regards,

Ashok



SQL Server Express2008 R2 brings app down, instance problem

  

I have tried dozens of changes and modifications to many settings as I will outilne here and all to no avail.

The short answer here though is that I uninstalled SQL Sever Express 2008 R2 and went back to the "NON" 2008 R2 and got things working. But like the fool I am wanted to run on the more current rev and updated again, all problems returned....

SPECS

Server:

Win Server 2003 R2 SP2

SQL SERVER EXPRESS 2009 R2

VWD2008 Express (removed)

IIS 6

 

Workstation:

XP Sp3

VWD2008 Express

SQL Server Express 2008

 

I was orginally getting this message after updating to SQL Sever Express 2008 R2, I removed VWD 2008 Express from the web server, no good, then uninstalled SQL Server 2008 Express R2 and reinstalled SQL Server 2008 Express. worked but had issues, couldn't install MGTM Studio. Then I removed SQL 2008, cleaned folders and reg. Reloaded SQL Server 2008 Express, still flaky, couldn't get the Management Studio to install. So I removed it again and used the Web Platform Installer, which worked but loaded 2008 R2 again. Which brought back the message.

Failed to genera

Info on the Go: Wireless Internet Database Connectivity with ASP, XML, and SQL Server

  

Many handheld wireless devices such as cellular phones and PDAs already have the ability to access Web sites. So how do you build Web applications that tap this wireless audience? Although there are a number of limitations to wireless devices-such as screen size, navigation, and connection speed-you can use familiar Web development technologies to make your existing Web applications available to mobile users. This article outlines the services and equipment currently available to support wireless Web access. A sample wireless-accessible Web site that dynamically draws data from a SQL Server database back end in real time is created using tools such as ASP and XML.

Srdjan Vujosevic and Robert Laberge

MSDN Magazine June 2000


how i can solve this issue in sql server

  

http://img291.imageshack.us/img291/9334/26896079.png


when i open my sql database in webmatrix then i got this error.  i already install sql server 2008 r2 and he work fine everywhere in my system.

how i can solve this issue.


Pick up old local users on new server with new local users with same name

  

Hi, All!

I has old server with name "test", worked with SQL server 2008 and Sharepoint 2007 SP2. There was five users like "user1", "user2", etc. They have content on main page "http://test" and some data at mysite host "http://test:81". Well I create new server with the same name "test", create all users "user1", "user2", etc, then i add them to shared services profiles with the same names like in old server. Then from old server backup content base from MS SQL server for applications on 80 and 81 port, and restore them on new server. Then I make commands "stsadm -o addcontentdb -url http://test -databasename wss_content_80" and "stsadm -o addcontentdb -url http://test:81 -databasename wss_content_81". Then I delete databases which created when i create new web applications from sharepoint central administration. and did iisreset. Well all data and settings picked up, BUT all user ID were old. So question is: how i can compare old users to new? I want to compare old and new users everywhere in DBs wss_content_80 and wss_content_81. Like replace old ID with new ID


Consuming External Data Using SharePoint Server 2010 Business Connectivity Services and an Excel 201

  
Learn how to use BCS in SharePoint Server 2010 to access and update external data by using Microsoft Excel 2010 as a client.
Categories: 
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