|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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"] |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
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? |
|
#4
|
||||
|
||||
|
what do you mean by "ShortHand" method?
|
|
#5
|
|||
|
|||
|
Quote:
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. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > No data exists for the row/column. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|