Solved

Select Parameter in ASP.net Object Data Source

Posted on 2009-06-30
2
289 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
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now