Re: No results from query in some contexts
From: Iain (Iain_at_idclTAKEAWAY.co.uk)
Date: 11/24/05
- Next message: mostro: "Manage SQL server accross WAN??"
- Previous message: m.bohse_at_quest-consultants.com: "Re: No results from query in some contexts"
- In reply to: Andrew J. Kelly: "Re: No results from query in some contexts"
- Next in thread: Andrew J. Kelly: "Re: No results from query in some contexts"
- Reply: Andrew J. Kelly: "Re: No results from query in some contexts"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 24 Nov 2005 16:05:40 +0000
On Thu, 24 Nov 2005 09:49:19 -0500, Andrew J. Kelly wrote:
> Can you at least show us the code? My guess would be one of two things.
> Either you are connecting to a different db or the ASP app is not formatting
> the query properly. More specifically it may be treating the value in the
> WHERE clause as the wrong datatype. But without seeing your query and the
> DDL for the table we can make guesses all day long.
Thanks for your replies!
A sample stored procedure is
ALTER PROCEDURE dbo.Test
AS
SET NOCOUNT ON
select * from aspnet_Users
RETURN
(I have FormsAuthentication running and the asphet_Users database has about
half a dozen records in).
If I execute this sproc from SQL Server Management studio connected to the
database, I get my half dozen records back.
If I execute the same procedure from within visual studio 2005 I get
ApplicationId UserId
UserName
LoweredUserName
MobileAlias IsAnonymous LastActivityDate
---- --- --
No rows affected.
(1 row(s) returned)
@RETURN_VALUE = 0
( I don't understand the one row returned, though!)
If I open up the table in visual studio 2005 I see the records.
If run the query in VS 2005 as a new query (select * from aspnet_Users) I
get the results I expect.
In both cases the connections are with Windows Authentication.
If I run my app and step through the code which calls one of the sprocs
(not this one a more complex one, but one which works in the Management
studio) I see that it returns no entries in the result set.
I do not see any errors being raised at any point - it's as ifhte result
set from a sproc just gets lost in some cases!
Having said all that the application is accessing some tables through
sprocs because the asp.net forms authentication is working, which means it
is getting data from the tables made by the aspnet membership wizards.
What is confusing me is that I get no data back. If i got an exception
because of security I'd see what to do!
Iain
-- Iain Downs (DirectShow MVP) Commercial Software Therapist www.idcl.co.uk
- Next message: mostro: "Manage SQL server accross WAN??"
- Previous message: m.bohse_at_quest-consultants.com: "Re: No results from query in some contexts"
- In reply to: Andrew J. Kelly: "Re: No results from query in some contexts"
- Next in thread: Andrew J. Kelly: "Re: No results from query in some contexts"
- Reply: Andrew J. Kelly: "Re: No results from query in some contexts"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|