Solved

Select Parameter in ASP.net Object Data Source

Posted on 2009-06-30
2
298 Views
Last Modified: 2012-05-07
Hello,
I have one ASP.NET web form that contain an Object Data Source OSD, and one Detail View.

The OSD is bound to a VB function that takes the user name in parameter to return specific data.

So, on the Page_Load event i wrote :

rODS.SelectParameters = User.Identity.Name

but it's not working, how can i get the ODS to select data regarding the userName when the page is on.
thanks
0
Comment
Question by:Nyana22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 24747123
Try this:
In Page_Load
ObjectDataSource1.SelectParameters("UserName")= User.Identity.Name

OR This:
In Selecting Event of ODS:

Protected Sub rODS_Selecting _
    (sender As Object, e As ObjectDataSourceSelectingEventArgs) _
        Handles ObjectDataSource1.Selecting
    e.InputParameters("UserName") = User.Identity.Name
End Sub

FYI: http://www.asp.net/learn/data-access/tutorial-06-vb.aspx
0
 

Author Closing Comment

by:Nyana22
ID: 31598400
Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question