Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 18th, 2006, 12:38 PM
Authorized User
Join Date: Apr 2005
Location: Vancouver, , Canada.
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL Error Locating Server/Instance Specified

Seems that this error has several conditions:

This is the error message:
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. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

SQL 2000
2000 Pro
Visual Studio C# 2005 Express

I have confirmed that the protocols TCP/IP & NamedPipes have been enabled. Is there anything else someone can help me with to get a connection to the datasource?

this is the code:
class Program
    static void Main(string[] args)
    // Specify SQL Server-specific connection string
    SqlConnection thisConnection = new SqlConnection(
    @"Server=(local)\SOHO;Integrated Security=True;" +

    // Create DataAdapter object
    SqlDataAdapter thisAdapter = new SqlDataAdapter(
    "SELECT siteid, vslname FROM tksiteid", thisConnection);

    // Create DataSet to contain related data tables,rows,columns
        DataSet thisDataSet = new DataSet();

    // Fill DataSet using query defined previously for DataAdapter
    thisAdapter.Fill(thisDataSet, "Customers");
    foreach (DataRow theRow in thisDataSet.Tables["Customers"].Rows)
    Console.WriteLine(theRow["siteid"] + "\t" + theRow["vslname"]);

    Console.Write("Program finished, press Enter/Return to continue:");



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to generate a user instance of SQL Server naeem.net SQL Server 2005 3 December 11th, 2009 02:45 PM
SQL Server Reg. SQL Server does not exist error Arsi SQL Server 2000 1 June 11th, 2008 11:20 AM
SQL user instance error ckerin BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 April 28th, 2008 12:30 AM
SQL Express User Instance...avoiding aspdewd SQL Server 2005 1 October 27th, 2007 10:12 PM

All times are GMT -4. The time now is 05:52 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.