Click here to Skip to main content
13,002,163 members (72,815 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am working on real estate web portal. I want to show posted ad in a grid view according to a login person for example:- if a person "A" is login on website and has posted some ads then if "A" want to show own ad. I want to do this.

Give me some clues...

Thanks in advance.
Posted 17-Nov-12 22:36pm
Krunal R 18-Nov-12 4:46am
which means you only person "A" have all rights for that ad and other can only see.. Am I right ?
SURBHI TYAGI 18-Nov-12 5:00am
no u r wrong...for everyone whoever login on site.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I have solved it.:)
on page load using this code.
protected void Page_Load(object sender, EventArgs e)
   SqlCommand SelectCommand = new SqlCommand("select Id,Title,owner from PostAd1 where owner=@owner",conn);
   SelectCommand.Parameters.Add("@owner", SqlDbType.NVarChar);
   SelectCommand.Parameters[0].Value = Convert.ToString(Session["username"].ToString());
   SqlDataAdapter da = new SqlDataAdapter(SelectCommand);
   Gridview1.DataSource = ds;

[edit]code block added[/edit]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 18 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100