473,663 Members | 2,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Querying Indexing Services from ASP.Net page

I am attempting to do the following, query indexing services through SQL
Server

SQL Server 2000/Visual Studio 2003

I have a linked server created called Web_service that points to a Server
running Indexing Services

I have created a stored procedure that is as follows:

CREATE procedure spQueryActiviti esWithIndex

@ActToDate varchar(20) = NULL,
@ActFromDate varchar(20)= NULL,
@CaseNumber varchar(13) = NULL,
@FullText varchar(3000) = NULL,
@OrderBy varchar(50) = NULL

as

declare @SQLStr varchar(2000)

Set @SQLSTR = 'SELECT va.*, LEFT(FILENAME, 21) AS Filename,
LEFT(REVERSE(SU BSTRING(REVERSE (DIRECTORY), 1, CHARINDEX(''\'' ,
REVERSE(DIRECTO RY)) - 1)) ' +
' + ''/'' + FILENAME, 40) AS Relative_Filena me, RANK,
HITCOUNT, CHARACTERIZATIO N FROM OPENQUERY(web_c ontent,' +
'''SELECT FileName, Directory, Rank, Hitcount,
Characterizatio n FROM psc017.docket.. SCOPE() WHERE '

if len(@FullText) > 0
Set @SQLSTR = @SQLSTR + ' CONTAINS(''''' + @FullText + ''''') AND '

Set @SQLSTR = @SQLSTR + ' filename <> ''''index.htm'' '' ORDER BY rank
desc'') Q' +
' INNER JOIN [Docket].[dbo].[ViewCaseActivit yWithFileNameEx t] VA on
VA.txtScanFileN ame = Q.FileName ' +
' WHERE VA.txtActivityT ype = ''Order'''

if len(@CaseNumber ) > 0
Set @SQLSTR = @SQLSTR + ' AND VA.txtCaseNumbe r like ''%' + @CaseNumber +
'%'''

if Len(@ActToDate) > 0
begin
if Len(@ActFromDat e) > 0
Set @SQLSTR = @SQLSTR + ' AND VA.dteActivity between ''' + @ActToDate
+ ''' and ''' + @ActFromDate + ''''
else
Set @SQLSTR = @SQLSTR + ' AND VA.dteActivity = ''' + @ActToDate + ''''
end

if Len(@Orderby) > 0
Set @SQLSTR = @SQLSTR + ' ORDER BY VA.' + @OrderBy

--print @SQLSTR
EXEC (@SQLSTR)

GO

I can run this fine from SQL Server becuase I have admin rights, but when I
run this from within my ASP.Net app with the following code, I get the
following error message.

DsIndex1.Tables ("spQueryActivi tiesWithIndex") .Clear()

daspQueryActivi tiesWithIndex.F ill(DsIndex1, "daspQueryActiv itiesWithIndex" )

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.Sql Client.SqlExcep tion: Login failed for user
'(null)'. Reason: Not associated with a trusted SQL Server connection.

I am new to ASP.NET so any help would greatly be apreciated.





Dec 28 '05 #1
7 1979
You need to Add the ASPNET account to the Database you have created the
Index in.

--
Best Regards

The Inimitable Mr Newbie º¿º

"C Jay Pemberton Jr" <jp********@psc .state.wv.us> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I am attempting to do the following, query indexing services through SQL
Server

SQL Server 2000/Visual Studio 2003

I have a linked server created called Web_service that points to a Server
running Indexing Services

I have created a stored procedure that is as follows:

CREATE procedure spQueryActiviti esWithIndex

@ActToDate varchar(20) = NULL,
@ActFromDate varchar(20)= NULL,
@CaseNumber varchar(13) = NULL,
@FullText varchar(3000) = NULL,
@OrderBy varchar(50) = NULL

as

declare @SQLStr varchar(2000)

Set @SQLSTR = 'SELECT va.*, LEFT(FILENAME, 21) AS Filename,
LEFT(REVERSE(SU BSTRING(REVERSE (DIRECTORY), 1, CHARINDEX(''\'' ,
REVERSE(DIRECTO RY)) - 1)) ' +
' + ''/'' + FILENAME, 40) AS Relative_Filena me,
RANK,
HITCOUNT, CHARACTERIZATIO N FROM OPENQUERY(web_c ontent,' +
'''SELECT FileName, Directory, Rank, Hitcount,
Characterizatio n FROM psc017.docket.. SCOPE() WHERE '

if len(@FullText) > 0
Set @SQLSTR = @SQLSTR + ' CONTAINS(''''' + @FullText + ''''') AND '

Set @SQLSTR = @SQLSTR + ' filename <> ''''index.htm'' '' ORDER BY rank
desc'') Q' +
' INNER JOIN [Docket].[dbo].[ViewCaseActivit yWithFileNameEx t] VA on
VA.txtScanFileN ame = Q.FileName ' +
' WHERE VA.txtActivityT ype = ''Order'''

if len(@CaseNumber ) > 0
Set @SQLSTR = @SQLSTR + ' AND VA.txtCaseNumbe r like ''%' + @CaseNumber +
'%'''

if Len(@ActToDate) > 0
begin
if Len(@ActFromDat e) > 0
Set @SQLSTR = @SQLSTR + ' AND VA.dteActivity between ''' + @ActToDate
+ ''' and ''' + @ActFromDate + ''''
else
Set @SQLSTR = @SQLSTR + ' AND VA.dteActivity = ''' + @ActToDate + ''''
end

if Len(@Orderby) > 0
Set @SQLSTR = @SQLSTR + ' ORDER BY VA.' + @OrderBy

--print @SQLSTR
EXEC (@SQLSTR)

GO

I can run this fine from SQL Server becuase I have admin rights, but when
I
run this from within my ASP.Net app with the following code, I get the
following error message.

DsIndex1.Tables ("spQueryActivi tiesWithIndex") .Clear()

daspQueryActivi tiesWithIndex.F ill(DsIndex1,
"daspQueryActiv itiesWithIndex" )

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.Sql Client.SqlExcep tion: Login failed for
user
'(null)'. Reason: Not associated with a trusted SQL Server connection.

I am new to ASP.NET so any help would greatly be apreciated.




Dec 28 '05 #2
Thank you for your prompt reply. I am sorry that I am nieve, but can you
provide links to the steps to add ASPNET user to SQL Server/Database?

Thanks

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 28 '05 #3
I went into SQL Server and tried to add the ASPNET user from my local
machine, but it gave me an error saying Unknown User/Group, so do I need
to have dotnet installed on the SQL Server so that I can use the ASPNET
account there? Is there anything that I have to do on the application
side to facilitate using the ASPNET account besides changing the
machine.config file, I tried that to no avail. Any additional help
would be appreciated.

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 29 '05 #4
This is a Bultin Account so it will be something like BUILTIN\ASPNET

--
Best Regards

The Inimitable Mr Newbie º¿º
"Jay Pemberton" <jp********@psc .state.wv.us> wrote in message
news:ez******** *****@TK2MSFTNG P12.phx.gbl...
I went into SQL Server and tried to add the ASPNET user from my local
machine, but it gave me an error saying Unknown User/Group, so do I need
to have dotnet installed on the SQL Server so that I can use the ASPNET
account there? Is there anything that I have to do on the application
side to facilitate using the ASPNET account besides changing the
machine.config file, I tried that to no avail. Any additional help
would be appreciated.

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Dec 29 '05 #5
I looked at the SQL Server through enterprise manager and tried to add a
user and did a seach for ASPNET and it didnt find a user called
BUILTIN\ASPNET, so does that mean that it dotnet isn't installed on the
SQL Server?

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 29 '05 #6
I looked at the SQL Server through enterprise manager and tried to add a
user and did a seach for ASPNET and it didnt find a user called
BUILTIN\ASPNET, so does that mean that it dotnet isn't installed on the
SQL Server?

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Dec 29 '05 #7
That is possible, but more likely you have not found the account yet.
Alternatively, it may be NT Authority\Netwo rk Service

--
Best Regards

The Inimitable Mr Newbie º¿º
"Jay Pemberton" <jp********@psc .state.wv.us> wrote in message
news:u0******** ******@TK2MSFTN GP12.phx.gbl...
I looked at the SQL Server through enterprise manager and tried to add a
user and did a seach for ASPNET and it didnt find a user called
BUILTIN\ASPNET, so does that mean that it dotnet isn't installed on the
SQL Server?

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Dec 29 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
7797
by: Jay | last post by:
Hello all. I've recently transferred our web sites from a Windows2000 server to a Windows2003 server. The transfer went almost flawless until I noticed that our search function isn't working anymore. I'm using an ASP script to use the Indexing Services and have set up my catalogs and directories but I'm getting a 'type mismatch' on one of my Server.URLEncode commands. Do I need to obtain a new script to utilize the Indexing Services of...
6
2648
by: Greg | last post by:
I am working on a project that will have about 500,000 records in an XML document. This document will need to be queried with XPath, and records will need to be updated. I was thinking about splitting up the XML into several XML documents (perhaps 50,000 per document) to be more efficient but this will make things a lot more complex because the searching needs to go accross all 500,000 records. Can anyone point me to some best practices...
1
3536
by: Don | last post by:
I am new to Indexing Services, have been researching the MS Site as well as web articles on DevHood, etc. I have set up a seperate catalog ("KnowledgeBase") on Win XP with a number of files. I am trying to use OLEDB through ADO to search results and serve them up onto an ASP.Net web page, yet I consistently get back 0 results. I have this working fine in a console application. I think my problem is I have to allow IIS access to my IS...
1
4747
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem I have run into I am not sure how to fix, and really not sure what is causing it. Here's what is going on (test server - Windows 2003 Server): I have a page in a folder (under anonymous authentication in IIS6) that has a link on it that...
3
1052
by: Maury | last post by:
Hi, I would like to know if it's possibile to interact with Windows Server Indexing Services from an ASP.NET page. Thanks M.A.
0
868
by: Jay.Pemberton | last post by:
I have stored procedure that does the following select into Indexing Services. SELECT LEFT(FILENAME, 21) AS Filename, LEFT(REVERSE(SUBSTRING(REVERSE(DIRECTORY), 1, CHARINDEX('\', REVERSE(DIRECTORY)) - 1)) + '/' + FILENAME, 40) AS Relative_Filename, RANK, HITCOUNT, CHARACTERIZATION FROM OPENQUERY(web_content,'SELECT FileName, Directory, Rank, Hitcount, Characterization FROM psc016.docket..SCOPE() WHERE filename <> ''index.htm'' ORDER...
0
4226
by: Chung Leong | last post by:
Here's a short tutorial on how to the OLE-DB extension to access Windows Indexing Service. Impress your office-mates with a powerful full-text search feature on your intranet. It's easier than you think. First, download and install the extension (http://sourceforge.net/project/showfiles.php?group_id=171247&package_id=198554). Simply unzip the file and copy the correct version of php_oledb.dll into the PHP extensions folder. Then add the...
2
1476
by: Steven Cheng [MSFT] | last post by:
Hi Cj, I also noticed that the "Act" variable here seems hasn't been declared(or declared anywhere else?). I've try building the same code and got the same result and the "Operator '+' cannot be applied to operands of type 'string' " error does pointing to the "Act.Trim" which should be of method call syntax such as Act.Trim() After change it, that error is eliminated.
2
8096
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a server 2008 IIS 7.0 with indexing service installed. I have created the catalog and have a test page using these posts: http://kbalertz.com/954822/install-configure-Indexing-Service-Windows-Server-computer.aspx http://kbalertz.com/820105/Application-Query-Indexing-Service-Catalog-Using-Visual-Basic.aspx I can search some files .xls .doc and others but It will not find anything in .pdf
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8771
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8548
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7371
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.