Wednesday, March 7, 2012

connection error with SQL server 2000

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=**secret**;database=pubs");
string str ="select * from authors";
SqlDataAdapter da =new SqlDataAdapter(str, con);
DataSet ds =new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();

his 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


Connect using TCP/IP, or use the Surface Area Configuration tool to enable remote connections using named pipes.

|||

I will be thankful if you explain me in some detail.

rajkumar sharma

No comments:

Post a Comment