Hello All,

Iam using Sql Server 2000. I want to Bind the Gridview with the Database, by giving the name of the
table in the "Use Data Source" option in the Smart Tag of the Gridview.

In the Add Connection Dialog Box I give "Microsoft SQL Server(SqlClient)"
as a Data source and "GUPTA-4E607DBAB\Administrator" as Server Name, which is set
as a Database Owner name. And I selected option "Use SQL Server Authentication" with "sa" user name and Password.
And gave Database name.

But when I tested the Connection I got an Error:-

"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 dafault settings SQL Server does not allow remote connections.
(provider:SQL Network Interfaces, error: 26-Error Locating Server/ Instance Specified)".

I urgent need to solve this problem. Anyone please tell me what should I do?

Thanks

Try just using GUPTA-4E607DBAB as your server name or go by IP as the \administrator is a user and not part of the SQL Server name

Data Source is name of ur computer

Simply you give Datasource=(local);.....

and you must give the correct username,password of the sql server(by default id=sa,password=root)

The datasource is an object. I typically bind to a datatable using the gridviews datasource property. If you need help with this I can help.

Thanks Bagurtheen, you really solved my problem, thanks again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.