Wrox Programmer Forums
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services 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 November 22nd, 2004, 01:56 AM
Friend of Wrox
Join Date: Sep 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default Linked Servers

I am working on SQL Server 2000.
I created one linked server from my local db like below
EXEC sp_addlinkedserver
   'Server=Sr1; Initial Catalog=sales;Integrated Security=SSPI;'
Here Sr1 is other Server Name .My PC and this server is on same network.

When i try to fetch the records its giving below error

OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize returned 0x80004005: ].

My select statement like below

select * from test.Sales.dbo.testTable

i tried like below also but both are giving above error.

DECLARE @OPENQUERY nvarchar(4000), @TSQL nvarchar(4000), @LinkedServer nvarchar(4000)
SET @LinkedServer = 'test'
SET @OPENQUERY = 'SELECT * FROM OPENQUERY('+ @LinkedServer + ','''
SET @TSQL = 'SELECT * FROM Sales.dbo.TestTable'')'

How to call linked server from ASP.Net can i try same thing in my ASPX page?
Pl help me

Old January 8th, 2005, 09:27 AM
Authorized User
Join Date: Nov 2004
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to avanishp

Try with SQL Enterprise Manager to link server follow these steps:
Go To Securit--->Linked Servers ---->New Linked Server:

Now on General tab put your sql server name and server type as SQL Server, at Security tab provide your login password for that server. n

Now fire that query, I think it will work.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked Servers anothervbaddict SQL Server 2000 5 November 30th, 2007 07:31 AM
LINKED Servers. WebLadyBug SQL Server 2005 1 April 9th, 2007 01:27 AM
Linked Servers rklio SQL Server 2005 0 February 5th, 2007 12:00 PM
linked servers msrnivas General .NET 1 November 26th, 2004 01:19 AM
linked servers bukky Classic ASP Databases 1 March 6th, 2004 06:31 AM

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