Showing posts with label details. Show all posts
Showing posts with label details. Show all posts

Tuesday, March 6, 2012

a SELECT statment, please help me

hello,

i have a page "Picture.aspx?PictureID=4"

i have a FormView witch shows details about that picture and uses a stored procedure with input parameter the "@.PictureID" token from query string

the Pictures table has among other rows "PictureID", "UserID" - uniqueidentifier - from witch user the picture belongs to

i have a second FormView on the same page, witch should show "other pictures from the same user" and uses a Stored Procedure

how should i write that stored procedure...frist to take the UserID from the picture with PictureID=4, then to pass it as input parameter and select the pictures witch has as owner the user with that UserID, and if can be done, to avoid showing the PictureID=4 again

a solution should be to add at querry the UserID too, but i want to avoid that

any sugestion is welcomed, please help me

THANKS

CREATE PROCEDURE GetPictures
@.UserId uniqueidentifier,
@.DisplayedPictureId int
AS
BEGIN
SELECT * FROM Pictures
WHERE UserId = @.UserId AND PictureID <> @.DisplayedPictureId
END

|||

hey, thanks for code

the DisplayedPictureId i take it from querry string, but how should i take the UserId trying to avoid puting it on querry string too

i heard something about Sesion or Cookie, is it good, but how should i use that?

|||

If you are using asp.net membership you can use Membership.GetUser().ProviderUserKey.ToString() to get UserId for logged in users.

|||

yes, but a visitor is not the "owner" of the picture...and the page is public to anonymous visitors too

|||

hey, i figured out how to do that

i save the UserId in a hiddenField (from the first formView) and then i use it as input parameter to second formView

thanks for help

Thursday, February 16, 2012

A particular row to be bold?

I am retrieving the rows and displaying them in table details of my report. The last row is the weighted mean and needs to be calculated in the stored procedure.

Now, I want to make this particular row in bold font. Is it possible? Please let me know.

Any help will be greatly appreciated !!!

You can select the entire table row and apply style property settings for the entire row. Assuming you have a column in your dataset that distinguishes the real "detail" rows from the weighted mean row, you could write an expression that uses this field to determine if a row should be shown normal or bold.

-- Robert