Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 24th, 2005, 07:04 AM
pdtn pdtn is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: South Australia
Posts: 41 pdtn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 47 sec
Reputation Power: 5
Send a message via MSN to pdtn
Question No data exists for the row/column.

Hey
I'm working on an MMORPG (Massive Multiplayer Online Role Playing Game) at the moment. Just started. On the left, there is a basic summary of the user's statistics (battle strengths, health, level, money, etc.), but when I run the query, ASP.NET returns the error :No data exists for the row/column.
This might be an obvious error, but I've copied the query into a view, and it returns the results i want.

The Stored Procedure is as follows :-
CREATE PROCEDURE generalQueryLeft
@idUser int
AS
SELECT dbo.users.userName, dbo.users.joined, dbo.finance.drales, dbo.finance.bank, dbo.finance.silverScales, dbo.finance.diamondScales, dbo.users.userID,
dbo.sp.endu, dbo.sp.maxEnd, dbo.sp.speed, dbo.sp.evasiveness, dbo.sp.accuracy, dbo.sp.mStrength, dbo.sp.mDefense,
dbo.sp.pStrength, dbo.sp.pDefense
FROM dbo.sp INNER JOIN
dbo.users ON dbo.sp.userID = dbo.users.userID INNER JOIN
dbo.finance ON dbo.users.userID = dbo.finance.userID
WHERE (dbo.sp.userID = @idUser)
GO

The Query is (in test mode) :-
"EXECUTE generalQueryLeft 1"
if it wasn't in test mode, it would be
"EXECUTE generalQueryLeft "+Request.Cookies["omega"]["user"]

Reply With Quote
  #2  
Old July 24th, 2005, 12:57 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,776 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 27 m 42 sec
Reputation Power: 470
post your .NET code where you execute the query.

You could also rewrite your query, like this, it makes it more readable and maintainable.
Code:

CREATE PROCEDURE stp_GeneralQueryLeft
   @UserID int
AS
SELECT A.Username,
   A.Joined,
   B.Drales,
   B.Bank,
   B.SilverScales,
   B.DiamondScales,
   A.UserID,
   C.Endu,
   C.MaxEnd,
   C.Speed,
   C.Evasiveness,
   C.Accuracy,
   C.MStrength,
   C.MDefense,
   C.PStrength,
   C.PDefense
FROM dbo.Users As A 
INNER JOIN dbo.Finance As B On (A.UserID = B.UserID)
INNER JOIN dbo.sp As C On (A.UserID = C.UserID)
WHERE A.UserID = @UserID

Last edited by Memnoch : July 24th, 2005 at 01:05 PM.

Reply With Quote
  #3  
Old July 24th, 2005, 09:38 PM
pdtn pdtn is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: South Australia
Posts: 41 pdtn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 47 sec
Reputation Power: 5
Send a message via MSN to pdtn
Problem Solvered - But I have another one

Yeah, i was just reading my code, and puttting comments in it so i could copy it into here so other people could help me, when I realised i didn't put in rs.Read(); (rs being the DataReader), so i put that in and it works.
But, i also want to know whether there's a shorthand method of requesting data from databases, just like classic ASP?

Reply With Quote
  #4  
Old July 25th, 2005, 11:30 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,776 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 27 m 42 sec
Reputation Power: 470
what do you mean by "ShortHand" method?

Reply With Quote
  #5  
Old July 28th, 2005, 02:54 AM
pdtn pdtn is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: South Australia
Posts: 41 pdtn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 47 sec
Reputation Power: 5
Send a message via MSN to pdtn
Quote:
Originally Posted by Memnoch
what do you mean by "ShortHand" method?


in classic ASP, you can just type, for instance endu=rs("endu") and it would return the value, but in ASP.NET, the method i know is to specify what row you're using, and get the data from the column in the command. I do know rs[int] but that doesn't work properly, and if it did, I'd have to refer to the retrieved data to find out what column's which.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > No data exists for the row/column.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT