Wrox Programmer Forums
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 1st, 2006, 08:48 PM
Authorized User
Join Date: May 2006
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default connection error with SQL

Hello All,
I am working in vwd using C#. In my web develpent I am Connecting to the Sql server 2000's pubs table and displaying result in GridView Control.
My Coding is

SqlConnection con = new SqlConnection("Server=local host;uid=sa;pwd=kumar;database=pubs");
        string str = "select * from authors";
        SqlDataAdapter da = new SqlDataAdapter(str, con);
        DataSet ds = new DataSet();
        GridView1.DataSource = ds;

This is a very simple Code.
Now I got a error which is

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: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server)

Can you tell me what is the problem here

rajkumar sharma
rajkumar sharma

Similar Threads
Thread Thread Starter Forum Replies Last Post
sql connection error navbingo20 ASP.NET 2.0 Basics 0 June 23rd, 2008 05:07 PM
Chapter 16 Sql connection error flashmanTom BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 May 22nd, 2008 05:04 PM
connection error with SQL sh.rajkumar ASP.NET 2.0 Basics 4 June 5th, 2006 11:30 PM
SQL server connection error Mayuri25 Pro VB Databases 4 September 12th, 2005 05:42 AM
SQL Server Connection error shivani_desai SQL Server 2000 1 January 16th, 2005 03:53 AM

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