View Single Post
  #1 (permalink)  
Old June 1st, 2006, 08:48 PM
sh.rajkumar sh.rajkumar is offline
Authorized User
Join Date: May 2006
Location: New Delhi, Delhi, India.
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